File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Auto-merge on successful release pipeline
1+ name : Auto-merge reusable workflow
22
33on :
44 workflow_call :
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
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,
You can’t perform that action at this time.
0 commit comments