From 5bb47057b0644419f1408cf7d297ab69cfe413e6 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 23 Apr 2022 20:58:46 +0800 Subject: [PATCH] chore: fix argos-ci check status in PR (#35193) * chore: batch upload argos-ci snapshots * test: added commit and branch back for ui-upload.yml --- .github/workflows/ui-upload.yml | 22 ++++++++++++++++++++++ .github/workflows/ui.yml | 30 ++++++++++++++++++++++++++++++ scripts/argos-upload.js | 6 +++--- 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ui-upload.yml b/.github/workflows/ui-upload.yml index 107b931e94..f2470f4dc4 100644 --- a/.github/workflows/ui-upload.yml +++ b/.github/workflows/ui-upload.yml @@ -23,6 +23,26 @@ jobs: - name: checkout uses: actions/checkout@v3 + - name: Download commit artifact + uses: dawidd6/action-download-artifact@v2 + with: + workflow: ${{ github.event.workflow_run.workflow_id }} + name: commit + + - name: Save commit id + id: commit + run: echo "::set-output name=id::$( ./commit.txt + + - name: Save commit + if: github.event_name == 'push' + run: echo ${{ github.sha }} > ./commit.txt + + - name: Upload commit + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: commit + path: ./commit.txt + + - name: Save branch + if: github.event_name == 'pull_request' && github.base_ref == 'master' + run: echo pull/${{ github.event.pull_request.number }}/merge > ./branch.txt + + - name: Save branch + if: github.event_name == 'push' + run: echo ${GITHUB_REF##*/} > ./branch.txt + + - name: Upload branch + if: ${{ always() }} + uses: actions/upload-artifact@v3 + with: + name: branch + path: ./branch.txt diff --git a/scripts/argos-upload.js b/scripts/argos-upload.js index f81158d795..5276a9d0f7 100644 --- a/scripts/argos-upload.js +++ b/scripts/argos-upload.js @@ -47,11 +47,11 @@ async function run() { '--batchCount', chunks.length, '--branch', - process.env.GITHUB_REF_NAME, + process.env.ARGOS_GITHUB_BRANCH, '--commit', - process.env.GITHUB_SHA, + process.env.ARGOS_GITHUB_COMMIT, '--external-build-id', - process.env.GITHUB_SHA, + process.env.ARGOS_GITHUB_COMMIT, ]); // eslint-disable-next-line no-console -- pipe stdout console.log(argosResults.stdout);