From d45126ca8aa31b46a3eb744e7cdfa0e22ee5663a Mon Sep 17 00:00:00 2001 From: Matt Fishman Date: Fri, 24 Mar 2023 08:47:00 -0400 Subject: [PATCH] [CI] Try to fix new comment trigger workflow example (#1102) --- .github/workflows/comment_trigger_example.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/comment_trigger_example.yml b/.github/workflows/comment_trigger_example.yml index a35f5a642e..7f816136b6 100644 --- a/.github/workflows/comment_trigger_example.yml +++ b/.github/workflows/comment_trigger_example.yml @@ -2,38 +2,36 @@ name: Example comment trigger # https://dev.to/zirkelc/trigger-github-workflow-for-comment-on-pull-request-45l2 +on: + issue_comment: + types: [created] + jobs: deploy: name: Deploy if: github.event.issue.pull_request && contains(github.event.comment.body, '/deploy') runs-on: ubuntu-latest - steps: - name: Get PR branch uses: xt0rted/pull-request-comment-branch@v1 id: comment-branch - - name: Set latest commit status as pending uses: myrotvorets/set-commit-status-action@master with: sha: ${{ steps.comment-branch.outputs.head_sha }} token: ${{ secrets.GITHUB_TOKEN }} status: pending - - name: Checkout PR branch uses: actions/checkout@v3 with: ref: ${{ steps.comment-branch.outputs.head_ref }} - - name: Setup Node.js 16 uses: actions/setup-node@v3 with: node-version: 16 - - name: Deploy run: | echo "Deploying..." - - name: Set latest commit status as ${{ job.status }} uses: myrotvorets/set-commit-status-action@master if: always() @@ -41,7 +39,6 @@ jobs: sha: ${{ steps.comment-branch.outputs.head_sha }} token: ${{ secrets.GITHUB_TOKEN }} status: ${{ job.status }} - - name: Add comment to PR uses: actions/github-script@v6 if: always()