mirror of
https://github.com/lucide-icons/lucide.git
synced 2025-12-28 21:49:44 +01:00
ci: fix PR comment workflow
This commit is contained in:
21
.github/workflows/comment-icon-preview.yml
vendored
21
.github/workflows/comment-icon-preview.yml
vendored
@@ -14,25 +14,30 @@ jobs:
|
||||
github.event.workflow_run.conclusion == 'success'
|
||||
steps:
|
||||
- name: 'Download artifact'
|
||||
uses: actions/github-script@v3.1.0
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
var artifacts = await github.actions.listWorkflowRunArtifacts({
|
||||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: ${{github.event.workflow_run.id }},
|
||||
run_id: context.payload.workflow_run.id,
|
||||
});
|
||||
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
|
||||
return artifact.name == "pr"
|
||||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
|
||||
return artifact.name == "pr_number"
|
||||
})[0];
|
||||
var download = await github.actions.downloadArtifact({
|
||||
let 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}}/pr.zip', Buffer.from(download.data));
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const temp = '${{ runner.temp }}/artifacts';
|
||||
if (!fs.existsSync(temp)){
|
||||
fs.mkdirSync(temp);
|
||||
}
|
||||
fs.writeFileSync(path.join(temp, 'pr_number.zip'), Buffer.from(download.data));
|
||||
|
||||
- run: unzip pr.zip
|
||||
|
||||
|
||||
Reference in New Issue
Block a user