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 55# More details can be found here:
66# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
77
8- name : Deploying dev-app to firebase previews
8+ name : Deploying dev-app to Firebase previews
99
1010on :
1111 workflow_run :
2222
2323 - name : ' Download artifact from build job'
2424 run : |
25- ./scripts/github/fetch-workflow-artifact.js ${{secrets.GITHUB_TOKEN}} \
25+ ./scripts/github/fetch-workflow-artifact.mjs ${{secrets.GITHUB_TOKEN}} \
2626 ${{github.event.workflow_run.id}} devapp > devapp.zip
2727
2828 - name : Extracting workflow artifact into Firebase public directory.
Original file line number Diff line number Diff line change 88 * ./fetch-workflow-artifact.js <gh-token> <workflow-id> <artifact-name>
99 */
1010
11- const { Octokit } = require ( '@octokit/rest' ) ;
11+ import octokit from '@octokit/rest' ;
1212
1313async function main ( ) {
1414 const [ owner , repo ] = process . env . GITHUB_REPOSITORY . split ( '/' , 2 ) ;
1515 const [ token , workflowId , artifactName ] = process . argv . slice ( 2 ) ;
16- const github = new Octokit ( { auth : token } ) ;
16+ const github = new octokit . Octokit ( { auth : token } ) ;
1717 const artifacts = await github . actions . listWorkflowRunArtifacts ( {
1818 owner,
1919 repo,
2020 run_id : workflowId ,
2121 } ) ;
2222
23- const matchArtifact = artifacts . data . artifacts . filter (
23+ const matchArtifact = artifacts . data . artifacts . find (
2424 artifact => artifact . name === artifactName ,
25- ) [ 0 ] ;
25+ ) ;
2626
2727 const download = await github . actions . downloadArtifact ( {
2828 owner,
@@ -34,7 +34,4 @@ async function main() {
3434 process . stdout . write ( Buffer . from ( download . data ) ) ;
3535}
3636
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