File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 5
5
# More details can be found here:
6
6
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
7
7
8
- name : Deploying dev-app to firebase previews
8
+ name : Deploying dev-app to Firebase previews
9
9
10
10
on :
11
11
workflow_run :
22
22
23
23
- name : ' Download artifact from build job'
24
24
run : |
25
- ./scripts/github/fetch-workflow-artifact.js ${{secrets.GITHUB_TOKEN}} \
25
+ ./scripts/github/fetch-workflow-artifact.mjs ${{secrets.GITHUB_TOKEN}} \
26
26
${{github.event.workflow_run.id}} devapp > devapp.zip
27
27
28
28
- name : Extracting workflow artifact into Firebase public directory.
Original file line number Diff line number Diff line change 8
8
* ./fetch-workflow-artifact.js <gh-token> <workflow-id> <artifact-name>
9
9
*/
10
10
11
- const { Octokit } = require ( '@octokit/rest' ) ;
11
+ import octokit from '@octokit/rest' ;
12
12
13
13
async function main ( ) {
14
14
const [ owner , repo ] = process . env . GITHUB_REPOSITORY . split ( '/' , 2 ) ;
15
15
const [ token , workflowId , artifactName ] = process . argv . slice ( 2 ) ;
16
- const github = new Octokit ( { auth : token } ) ;
16
+ const github = new octokit . Octokit ( { auth : token } ) ;
17
17
const artifacts = await github . actions . listWorkflowRunArtifacts ( {
18
18
owner,
19
19
repo,
20
20
run_id : workflowId ,
21
21
} ) ;
22
22
23
- const matchArtifact = artifacts . data . artifacts . filter (
23
+ const matchArtifact = artifacts . data . artifacts . find (
24
24
artifact => artifact . name === artifactName ,
25
- ) [ 0 ] ;
25
+ ) ;
26
26
27
27
const download = await github . actions . downloadArtifact ( {
28
28
owner,
@@ -34,7 +34,4 @@ async function main() {
34
34
process . stdout . write ( Buffer . from ( download . data ) ) ;
35
35
}
36
36
37
- main ( ) . catch ( e => {
38
- console . error ( e ) ;
39
- process . exitCode = 1 ;
40
- } ) ;
37
+ await main ( ) ;
You can’t perform that action at this time.
0 commit comments