Skip to content

Commit 648094d

Browse files
committed
fix: rename workflow and simplify head_branch handling in auto-merge script
1 parent 1cc033e commit 648094d

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

.github/workflows/auto-merge-on-release.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Auto-merge on successful release pipeline
1+
name: Auto-merge reusable workflow
22

33
on:
44
workflow_call:
@@ -21,15 +21,8 @@ jobs:
2121
with:
2222
github-token: ${{ secrets.GITHUB_TOKEN }}
2323
script: |
24-
// Support both automatic workflow_run triggers and explicit workflow_call inputs.
25-
const run = context.payload.workflow_run;
26-
let head_branch = '';
27-
if (run && run.head_branch) {
28-
head_branch = run.head_branch;
29-
} else if (context.payload && context.payload.inputs && context.payload.inputs.head_branch) {
30-
head_branch = context.payload.inputs.head_branch;
31-
}
32-
24+
// Use the provided input; caller should supply `head_branch` when invoking.
25+
const head_branch = "${{ inputs.head_branch }}";
3326
const owner = context.repo.owner;
3427
const repo = context.repo.repo;
3528
@@ -40,7 +33,6 @@ jobs:
4033
4134
core.info(`Auto-merge triggered for branch: ${head_branch}`);
4235
43-
// Find an open PR whose head ref matches the branch
4436
const prs = await github.rest.pulls.list({
4537
owner,
4638
repo,

0 commit comments

Comments
 (0)