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
This commit is contained in:
afc163 2022-04-23 20:58:46 +08:00 committed by GitHub
parent a9806a2be0
commit 5bb47057b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 3 deletions

View File

@ -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: Download branch artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: branch
- name: Save branch id
id: branch
run: echo "::set-output name=id::$(<branch.txt)"
- name: Download snapshots artifact
uses: dawidd6/action-download-artifact@v2
with:
@ -39,3 +59,5 @@ jobs:
run: npm run argos
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
ARGOS_GITHUB_BRANCH: ${{ steps.branch.outputs.id }}
ARGOS_GITHUB_COMMIT: ${{ steps.commit.outputs.id }}

View File

@ -58,3 +58,33 @@ jobs:
name: snapshots
path: imageSnapshots/
retention-days: 3
- name: Save commit
if: github.event_name == 'pull_request' && github.base_ref == 'master'
run: echo ${{ github.event.pull_request.head.sha }} > ./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

View File

@ -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);