Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 6003e97

Browse files
authored
Merge pull request #271 from kubernetes-sigs/pr-post-updatte
🏃 Update pr-post github action
2 parents 81eb48a + 98312eb commit 6003e97

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

.github/workflows/pr-post.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,31 @@ jobs:
77
e2e-smoketest:
88
name: E2E Smoketest
99
runs-on: ubuntu-latest
10-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
10+
if: >
11+
${{ github.event.workflow_run.event == 'pull_request' &&
12+
github.event.workflow_run.conclusion == 'success' }}
1113
steps:
12-
- name: checkout
13-
uses: actions/[email protected]
14-
- uses: actions/setup-go@v2
14+
- name: 'Download artifact'
15+
uses: actions/[email protected]
1516
with:
16-
go-version: '1.16' # The Go version to download (if necessary) and use.
17-
- name: download e2e artifacts
18-
uses: actions/download-artifact@v2
19-
with:
20-
name: e2e-artifacts
21-
path: /tmp/e2e-artifacts
17+
script: |
18+
var artifacts = await github.actions.listWorkflowRunArtifacts({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
run_id: ${{github.event.workflow_run.id }},
22+
});
23+
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
24+
return artifact.name == "e2e-artifacts"
25+
})[0];
26+
var download = await github.actions.downloadArtifact({
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
artifact_id: matchArtifact.id,
30+
archive_format: 'zip',
31+
});
32+
var fs = require('fs');
33+
fs.writeFileSync('${{github.workspace}}/e2e-artifacts.zip', Buffer.from(download.data));
34+
- run: unzip e2e-artifacts.zip
2235
- name: Display structure of downloaded files
2336
run: ls -R
2437
working-directory: /tmp/e2e-artifacts

0 commit comments

Comments
 (0)