Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: switch to v4 artifact handling #8

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/dco-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ jobs:
echo ${{ github.event.pull_request.head.sha }} > result/head
dco-check -v
touch result/success
- uses: actions/upload-artifact@v3
- name: Upload result
uses: actions/upload-artifact@v4
if: always()
with:
name: result
Expand Down
24 changes: 5 additions & 19 deletions .github/workflows/dco-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,16 @@ jobs:
if: ${{ github.event.workflow_run.event == 'pull_request' }}
steps:
- name: Download state
uses: actions/github-script@v7
uses: actions/download-artifact@v4
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "result"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{ github.workspace }}/result.zip', Buffer.from(download.data));
name: result
path: result
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Read state
id: result
run: |
unzip -d result result.zip
echo "pr=$(cat result/pr)" >> $GITHUB_OUTPUT
echo "base=$(cat result/base)" >> $GITHUB_OUTPUT
echo "head=$(cat result/head)" >> $GITHUB_OUTPUT
Expand Down