From 2f32b0c003198f481b6050280455c982d475b7bf Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 22 Jun 2023 15:08:00 +0000 Subject: [PATCH 1/3] fix a syntax issue --- .github/workflows/pr-deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-deploy.yaml b/.github/workflows/pr-deploy.yaml index 8a451de835b88..0db6fbcec5f1d 100644 --- a/.github/workflows/pr-deploy.yaml +++ b/.github/workflows/pr-deploy.yaml @@ -37,9 +37,9 @@ jobs: id: pr_number run: | set -euxo pipefail - if [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then + if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then PR_NUMBER=${{ github.event.inputs.pr_number }} - PR_TITLE=$(curl -sSL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/coder/coder/pulls/$PR_NUMBER | jq -r '.title') + PR_TITLE=$(curl -sSL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/coder/coder/pulls/$PR_NUMBER" | jq -r '.title') else PR_NUMBER=${{ github.event.issue.number }} PR_TITLE=${{ github.event.issue.title }} From 687d17f8abc81a97b69d004e4718a0627efd7790 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 22 Jun 2023 15:14:01 +0000 Subject: [PATCH 2/3] fix trigger --- .github/workflows/pr-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-deploy.yaml b/.github/workflows/pr-deploy.yaml index 0db6fbcec5f1d..e513662c12e0c 100644 --- a/.github/workflows/pr-deploy.yaml +++ b/.github/workflows/pr-deploy.yaml @@ -22,7 +22,7 @@ concurrency: jobs: pr_commented: - if: ${{ github.event.issue.pull_request }} && contains(github.event.comment.body, '/deploy-pr') && github.event.comment.author_association == 'MEMBER' || github.event_name == 'workflow_dispatch' + if: ${{ github.event_name == 'issue_comment' }} && contains(github.event.comment.body, '/deploy-pr') && github.event.comment.author_association == 'MEMBER' || github.event_name == 'workflow_dispatch' outputs: PR_NUMBER: ${{ steps.pr_number.outputs.PR_NUMBER }} PR_TITLE: ${{ steps.pr_number.outputs.PR_TITLE }} From 1e2cac0e3ceb9ded9218b98274f9f860987f5056 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Thu, 22 Jun 2023 15:17:11 +0000 Subject: [PATCH 3/3] fix condition --- .github/workflows/pr-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-deploy.yaml b/.github/workflows/pr-deploy.yaml index e513662c12e0c..3b3ef284361c0 100644 --- a/.github/workflows/pr-deploy.yaml +++ b/.github/workflows/pr-deploy.yaml @@ -22,7 +22,7 @@ concurrency: jobs: pr_commented: - if: ${{ github.event_name == 'issue_comment' }} && contains(github.event.comment.body, '/deploy-pr') && github.event.comment.author_association == 'MEMBER' || github.event_name == 'workflow_dispatch' + if: github.event_name == 'issue_comment' && contains(github.event.comment.body, '/deploy-pr') && github.event.comment.author_association == 'MEMBER' || github.event_name == 'workflow_dispatch' outputs: PR_NUMBER: ${{ steps.pr_number.outputs.PR_NUMBER }} PR_TITLE: ${{ steps.pr_number.outputs.PR_TITLE }}