8080 const body = `@${author} thanks! Kicking off a sweep.\n\nRun: ${runUrl}\nApproval: required in environment 'bryan-test'.`;
8181 await github.rest.issues.createComment({ owner, repo, issue_number, body });
8282
83- - name : Reply with run link (manual trigger)
84- if : ${{ github.event_name == 'workflow_dispatch' && steps.resolve.outputs.pr-number != '' }}
85- uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
86- env :
87- RUN_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
88- AUTHOR : ${{ github.actor }}
89- ISSUE_NUMBER : ${{ steps.resolve.outputs.pr-number }}
90- with :
91- script : |
92- const owner = context.repo.owner;
93- const repo = context.repo.repo;
94- const issue_number = process.env.ISSUE_NUMBER;
95- const runUrl = process.env.RUN_URL;
96- const author = process.env.AUTHOR;
97- const body = `@${author} triggered a manual sweep.\n\nRun: ${runUrl}\n(Manual run on branch ${context.ref})`;
98- await github.rest.issues.createComment({ owner, repo, issue_number, body });
99-
10083 - name : Find PR for this branch (if any)
10184 id : find
10285 if : ${{ github.event_name != 'issue_comment' }}
@@ -130,9 +113,43 @@ jobs:
130113 echo "pr-number=$pr_number" >> "$GITHUB_OUTPUT"
131114 echo "generator-args=$gen_args" >> "$GITHUB_OUTPUT"
132115
116+ - name : Reply with run link (manual trigger)
117+ if : ${{ github.event_name == 'workflow_dispatch' && steps.resolve.outputs.pr-number != '' }}
118+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
119+ env :
120+ RUN_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
121+ AUTHOR : ${{ github.actor }}
122+ ISSUE_NUMBER : ${{ steps.resolve.outputs.pr-number }}
123+ with :
124+ script : |
125+ const owner = context.repo.owner;
126+ const repo = context.repo.repo;
127+ const issue_number = process.env.ISSUE_NUMBER;
128+ const runUrl = process.env.RUN_URL;
129+ const author = process.env.AUTHOR;
130+ const body = `@${author} triggered a manual sweep.\n\nRun: ${runUrl}\n(Manual run on branch ${context.ref})`;
131+ await github.rest.issues.createComment({ owner, repo, issue_number, body });
132+
133+ - name : Reply with run link (push trigger)
134+ if : ${{ github.event_name == 'push' && steps.resolve.outputs.pr-number != '' }}
135+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
136+ env :
137+ RUN_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
138+ AUTHOR : ${{ github.actor }}
139+ ISSUE_NUMBER : ${{ steps.resolve.outputs.pr-number }}
140+ with :
141+ script : |
142+ const owner = context.repo.owner;
143+ const repo = context.repo.repo;
144+ const issue_number = process.env.ISSUE_NUMBER;
145+ const runUrl = process.env.RUN_URL;
146+ const author = process.env.AUTHOR;
147+ const body = `@${author} pushed changes and triggered a sweep.\n\nRun: ${runUrl}\n(Push on ${context.ref})`;
148+ await github.rest.issues.createComment({ owner, repo, issue_number, body });
149+
133150 approval :
134151 needs : get-jobs
135- if : ${{ needs.get-jobs.outputs.generator-args != '' }}
152+ if : ${{ github.event_name == 'issue_comment' && needs.get-jobs.outputs.pr-number != '' && needs.get-jobs.outputs.generator-args != '' }}
136153 runs-on : ubuntu-latest
137154 name : approval
138155 environment : bryan-test
@@ -141,7 +158,7 @@ jobs:
141158
142159 validate :
143160 needs : [get-jobs, approval]
144- if : ${{ needs.get-jobs.outputs.generator-args != '' }}
161+ if : ${{ github.event_name == 'issue_comment' && needs.get-jobs.outputs.pr-number != '' && needs.get-jobs.outputs.generator-args != '' }}
145162 uses : ./.github/workflows/e2e-tests.yml
146163 name : validate
147164 secrets : inherit
0 commit comments