diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c57e3940b..a378dca31 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,6 +11,8 @@ on: - synchronize paths-ignore: - '**.md' + issue_comment: + types: [created] workflow_dispatch: inputs: PUBLISH: @@ -66,8 +68,20 @@ env: DEFAULT_MANIFEST_ARTIFACT_NAME: bumped-manifest jobs: + pre-flight: + runs-on: ubuntu-22.04 + if: > + github.event_name == 'issue_comment' && + github.event.issue.pull_request && + contains(github.event.comment.body, '/cicd') + steps: + - name: Triggered by comment + shell: bash + run: exit 0 + metadata: runs-on: ubuntu-22.04 + needs: pre-flight outputs: BUILD_DATE: ${{ steps.date.outputs.BUILD_DATE }} PUBLISH: ${{ steps.if-publish.outputs.PUBLISH }} @@ -77,15 +91,15 @@ jobs: MERGE_BUMPED_MANIFEST: ${{ steps.manifest-branch.outputs.MERGE_BUMBED_MANIFEST }} TEST_SUBSET: ${{ steps.testset.outputs.TEST_SUBSET }} steps: - - name: Cancel workflow run if the trigger is a draft PR - id: cancel-if-draft - if: github.event_name == 'pull_request' && github.event.pull_request.draft == true - run: | - echo "Cancelling workflow for draft PR" - curl -X POST -H "Authorization: token ${{ github.token }}" \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" - while true; do sleep 1; done # blocks execution in case workflow cancellation takes time + # - name: Cancel workflow run if the trigger is a draft PR + # id: cancel-if-draft + # if: github.event_name == 'pull_request' && github.event.pull_request.draft == true + # run: | + # echo "Cancelling workflow for draft PR" + # curl -X POST -H "Authorization: token ${{ github.token }}" \ + # -H "Accept: application/vnd.github.v3+json" \ + # "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" + # while true; do sleep 1; done # blocks execution in case workflow cancellation takes time - name: Set build date id: date