Skip to content

Commit

Permalink
chore: fix argos-ci check status in PR (#35193)
Browse files Browse the repository at this point in the history
* chore: batch upload argos-ci snapshots

* test: added commit and branch back for ui-upload.yml
  • Loading branch information
afc163 committed Apr 23, 2022
1 parent a9806a2 commit 5bb4705
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ui-upload.yml
Expand Up @@ -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:
Expand All @@ -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 }}
30 changes: 30 additions & 0 deletions .github/workflows/ui.yml
Expand Up @@ -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
6 changes: 3 additions & 3 deletions scripts/argos-upload.js
Expand Up @@ -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);
Expand Down

0 comments on commit 5bb4705

Please sign in to comment.