From 7d48a51e102ea69ae9e97749f0d08f5067ab6a2a Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Tue, 25 Jul 2023 19:29:20 +0000 Subject: [PATCH] use gh cli --- .github/workflows/pr-deploy.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr-deploy.yaml b/.github/workflows/pr-deploy.yaml index dc22609b48592..cb9534ec2f0de 100644 --- a/.github/workflows/pr-deploy.yaml +++ b/.github/workflows/pr-deploy.yaml @@ -39,18 +39,15 @@ jobs: id: pr_number run: | set -euxo pipefail - if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then - PR_NUMBER=${{ github.event.inputs.pr_number }} - PR_TITLE=$(gh pr view $PR_NUMBER --json title | jq -r '.title') - else - PR_NUMBER=${{ github.event.issue.number }} - PR_TITLE='${{ github.event.issue.title }}' - fi + PR_NUMBER=$(gh pr view ${{ github.event.inputs.pr_number }} --json number | jq -r '.number') + PR_TITLE=$(gh pr view $PR_NUMBER --json title | jq -r '.title') PR_BRANCH=$(gh pr view $PR_NUMBER --json headRefName | jq -r '.headRefName') echo "PR_URL=https://github.com/coder/coder/pull/$PR_NUMBER" >> $GITHUB_OUTPUT echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT echo "PR_TITLE=$PR_TITLE" >> $GITHUB_OUTPUT echo "PR_BRANCH=$PR_BRANCH" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set required tags id: set_tags