mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
workflow: Fix second step of PR review labeling (#792)
This commit is contained in:
parent
8f4afefbf4
commit
a5111a23e0
33
.github/workflows/pr-status-label-review.yml
vendored
33
.github/workflows/pr-status-label-review.yml
vendored
|
|
@ -14,18 +14,41 @@ jobs:
|
|||
review_update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download review info
|
||||
uses: actions/download-artifact@v4
|
||||
- name: 'Download artifact'
|
||||
uses: actions/github-script@v8
|
||||
with:
|
||||
name: review-event
|
||||
path: .
|
||||
script: |
|
||||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: context.payload.workflow_run.id,
|
||||
});
|
||||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
|
||||
return artifact.name == "review-event"
|
||||
})[0];
|
||||
let download = await github.rest.actions.downloadArtifact({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
artifact_id: matchArtifact.id,
|
||||
archive_format: 'zip',
|
||||
});
|
||||
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, 'review-event.zip'), Buffer.from(download.data));
|
||||
|
||||
- name: 'Unzip artifact'
|
||||
run: unzip "${{ runner.temp }}/artifacts/review-event.zip" -d "${{ runner.temp }}/artifacts"
|
||||
|
||||
- name: Update status labels based on review
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
const data = JSON.parse(fs.readFileSync('event.json', 'utf8'));
|
||||
const data = JSON.parse(fs.readFileSync('${{ runner.temp }}/artifacts/event.json', 'utf8'));
|
||||
|
||||
const owner = data.repository.owner;
|
||||
const repo = data.repository.name;
|
||||
|
|
|
|||
Loading…
Reference in a new issue