Skip to content

Commit

Permalink
Test different context
Browse files Browse the repository at this point in the history
  • Loading branch information
Kas-tle authored Apr 14, 2024
1 parent 7a1e4db commit 004ee3a
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,10 @@ jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: 'Download all artifacts'
uses: actions/[email protected]
- uses: actions/download-artifact@v4
with:
script: |
const run_id = ${{ github.event.inputs.runId }};
const artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: run_id,
});
// Loop through all artifacts and download them
for (const artifact of artifacts.data.artifacts) {
const download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: 'zip',
});
const fs = require('fs');
// Write each artifact to a separate file named after the artifact
fs.writeFileSync(`${{github.workspace}}/${artifact.name}.zip`, Buffer.from(download.data));
}
run-id: ${{ github.event.inputs.runId }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Unzip artifacts'
run: |
mkdir -p ${{github.workspace}}/artifacts
Expand Down

0 comments on commit 004ee3a

Please sign in to comment.