|
| 1 | +name: "On Issue Comment" |
| 2 | + |
| 3 | +on: |
| 4 | + issue_comment: |
| 5 | + types: [created] |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + issues: read |
| 10 | + |
| 11 | +jobs: |
| 12 | + # This job always runs to prevent GHA from marking the run as failed when |
| 13 | + # all other jobs are skipped. |
| 14 | + noop: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - run: echo "No-op" |
| 18 | + |
| 19 | + parse_comment: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + if: | |
| 22 | + github.event.issue.pull_request == null && |
| 23 | + contains(github.event.issue.labels.*.name, 'type: release') && |
| 24 | + (github.event.comment.author_association == 'OWNER' || |
| 25 | + github.event.comment.author_association == 'MEMBER' || |
| 26 | + github.event.comment.author_association == 'COLLABORATOR') |
| 27 | + outputs: |
| 28 | + command: ${{ steps.parse.outputs.command }} |
| 29 | + issue_number: ${{ github.event.issue.number }} |
| 30 | + steps: |
| 31 | + - name: Parse comment |
| 32 | + id: parse |
| 33 | + env: |
| 34 | + COMMENT_BODY: ${{ github.event.comment.body }} |
| 35 | + run: | |
| 36 | + if echo "$COMMENT_BODY" | grep -qE '^[[:space:]]*/create-rc([[:space:]]|$)'; then |
| 37 | + echo "command=create-rc" >> "$GITHUB_OUTPUT" |
| 38 | + elif echo "$COMMENT_BODY" | grep -qE '^[[:space:]]*/prepare([[:space:]]|$)'; then |
| 39 | + echo "command=prepare" >> "$GITHUB_OUTPUT" |
| 40 | + elif echo "$COMMENT_BODY" | grep -qE '^[[:space:]]*/process-backports([[:space:]]|$)'; then |
| 41 | + echo "command=process-backports" >> "$GITHUB_OUTPUT" |
| 42 | + else |
| 43 | + echo "command=none" >> "$GITHUB_OUTPUT" |
| 44 | + fi |
| 45 | +
|
| 46 | + call_create_rc: |
| 47 | + needs: parse_comment |
| 48 | + if: needs.parse_comment.outputs.command == 'create-rc' |
| 49 | + uses: ./.github/workflows/release_create_rc.yaml |
| 50 | + with: |
| 51 | + issue: ${{ needs.parse_comment.outputs.issue_number }} |
| 52 | + secrets: inherit |
| 53 | + |
| 54 | + call_prepare: |
| 55 | + needs: parse_comment |
| 56 | + if: needs.parse_comment.outputs.command == 'prepare' |
| 57 | + uses: ./.github/workflows/release_prepare.yaml |
| 58 | + with: |
| 59 | + issue: ${{ needs.parse_comment.outputs.issue_number }} |
| 60 | + secrets: inherit |
| 61 | + |
| 62 | + call_process_backports: |
| 63 | + needs: parse_comment |
| 64 | + if: needs.parse_comment.outputs.command == 'process-backports' |
| 65 | + uses: ./.github/workflows/release_process_backports.yaml |
| 66 | + with: |
| 67 | + issue: ${{ needs.parse_comment.outputs.issue_number }} |
| 68 | + secrets: inherit |
0 commit comments