Skip to content

Commit aabdb16

Browse files
committed
fixup! build: setup preview builds for dev-app
Address feedback
1 parent 4784df7 commit aabdb16

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

.github/workflows/deploy-dev-app.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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

1010
on:
1111
workflow_run:
@@ -22,7 +22,7 @@ jobs:
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.

scripts/github/fetch-workflow-artifact.js renamed to scripts/github/fetch-workflow-artifact.mjs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
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

1313
async 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();

0 commit comments

Comments
 (0)