From 7a79833f0b2b338cfb5531449b9bcf5290b9ae9a Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 28 Jun 2021 19:20:55 -0700 Subject: [PATCH] Meta: fix passing PR number (see #2260) --- .github/workflows/preview-build.yml | 4 +--- .github/workflows/preview.yml | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index 12ae549fa4..1c0c251fd9 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -7,9 +7,6 @@ jobs: build: name: 'build PR preview' runs-on: ubuntu-latest - outputs: - sha: ${{ github.event.pull_request.head.sha }} - pr: ${{ github.event.number }} steps: - uses: actions/checkout@v2 @@ -20,6 +17,7 @@ jobs: use-npm-ci: true - run: npm run build-only - run: node scripts/insert_snapshot_warning + - run: echo ${{ github.event.number }} > out/pr.txt - uses: actions/upload-artifact@v2 with: name: out diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 9dd4f85fbd..063873ed9c 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -49,8 +49,9 @@ jobs: with: script: | console.log(${{ toJson(github.event) }}); + - run: echo "PULL_REQUEST=$(cat out/pr.txt)" >> $GITHUB_ENV + - run: rm out/pr.txt && echo $PULL_REQUEST - run: node scripts/publish-preview env: CI_PREVIEW_TOKEN: ${{ secrets.CI_PREVIEW_TOKEN }} - PULL_REQUEST: ${{ github.event.workflow_run.pull_requests['0'].number }} GITHUB_HEAD_SHA: ${{ github.event.workflow_run.head_commit.id }}