|
6 | 6 |
|
7 | 7 | jobs: |
8 | 8 | trigger-build: |
9 | | - if: github.event.issue.pull_request |
| 9 | + if: github.event.issue.pull_request && startsWith(github.event.comment.body, '.build') |
10 | 10 | runs-on: ubuntu-slim |
11 | 11 | permissions: |
12 | 12 | actions: write |
@@ -44,21 +44,21 @@ jobs: |
44 | 44 | if: steps.command.outputs.continue == 'true' && steps.get-branch.outputs.same_repo == 'true' |
45 | 45 | env: |
46 | 46 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + BRANCH: ${{ steps.get-branch.outputs.branch }} |
47 | 48 | run: | |
48 | | - gh workflow run build-dmg.yml --ref ${{ steps.get-branch.outputs.branch }} -R ${{ github.repository }} |
49 | | -
|
| 49 | + gh workflow run build-dmg.yml --ref "$BRANCH" -R "${{ github.repository }}" |
50 | 50 | - name: Comment on PR |
51 | 51 | if: steps.command.outputs.continue == 'true' && steps.get-branch.outputs.same_repo == 'true' |
52 | 52 | env: |
53 | 53 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
54 | 54 | run: | |
55 | 55 | PR_NUMBER="${{ github.event.issue.number }}" |
56 | | - gh pr comment $PR_NUMBER --body "Build triggered for branch `${{ steps.get-branch.outputs.branch }}`. Check the Actions tab for progress." -R ${{ github.repository }} |
| 56 | + gh pr comment "$PR_NUMBER" --body "Build triggered for branch \`${{ steps.get-branch.outputs.branch }}\`. Check the Actions tab for progress." -R "${{ github.repository }}" |
57 | 57 |
|
58 | 58 | - name: Comment on PR for fork |
59 | | - if: steps.command.outputs.continue == 'true' && steps.get-branch.outputs.same_repo != 'true' |
| 59 | + if: steps.command.outputs.continue == 'true' && steps.get-branch.outputs.same_repo == 'false' |
60 | 60 | env: |
61 | 61 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
62 | 62 | run: | |
63 | 63 | PR_NUMBER="${{ github.event.issue.number }}" |
64 | | - gh pr comment $PR_NUMBER --body "Build was not triggered automatically because this pull request comes from a fork, and branch `${{ steps.get-branch.outputs.branch }}` does not exist in `${{ github.repository }}`." -R ${{ github.repository }} |
| 64 | + gh pr comment "$PR_NUMBER" --body "Build was not triggered automatically because this pull request comes from a fork. A maintainer can trigger it manually by running the \`build-dmg\` workflow against branch \`${{ steps.get-branch.outputs.branch }}\`." -R "${{ github.repository }}" |
0 commit comments