Use separate artifact name per step (#11690)

Compatibility with actions/upload-artifact@v4
This commit is contained in:
Sebastian Rittau
2024-04-07 15:04:37 +02:00
committed by GitHub
parent 7e01591643
commit 26383eed33
2 changed files with 14 additions and 12 deletions

View File

@@ -62,7 +62,7 @@ jobs:
- name: Upload mypy_primer diff
uses: actions/upload-artifact@v3
with:
name: mypy_primer_diffs
name: mypy_primer_diff_${{ matrix.shard-index }}
path: diff_${{ matrix.shard-index }}.txt
- if: ${{ matrix.shard-index }} == 0
name: Save PR number
@@ -72,5 +72,5 @@ jobs:
name: Upload PR number
uses: actions/upload-artifact@v3
with:
name: mypy_primer_diffs
name: mypy_primer_diff_pr_number
path: pr_number.txt

View File

@@ -27,18 +27,20 @@ jobs:
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }},
});
const [matchArtifact] = artifacts.data.artifacts.filter((artifact) =>
artifact.name == "mypy_primer_diffs");
const matchArtifacts = artifacts.data.artifacts.filter((artifact) =>
artifact.name.startsWith("mypy_primer_diff"));
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: "zip",
});
fs.writeFileSync("diff.zip", Buffer.from(download.data));
for (const matchArtifact of matchArtifacts) {
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: "zip",
});
fs.writeFileSync(`${matchArtifact.name}.zip`, Buffer.from(download.data));
}
- run: unzip diff.zip
- run: for file in *.zip; do unzip $file; done
- run: |
cat diff_*.txt | tee fulldiff.txt