diff --git a/.github/workflows/pr-deploy.yaml b/.github/workflows/pr-deploy.yaml index 8a451de835b88..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.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 }} @@ -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 }}