mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
workflows/labels: save artifacts per PR
Previously, the artifacts of different PRs would overwrite each other, thus leading to odd JSON parsing errors.
This commit is contained in:
6
.github/workflows/labels.yml
vendored
6
.github/workflows/labels.yml
vendored
@@ -137,7 +137,7 @@ jobs:
|
||||
repositoryOwner: context.repo.owner,
|
||||
token: core.getInput('github-token')
|
||||
},
|
||||
path: path.resolve('comparison'),
|
||||
path: path.resolve(pull_request.number.toString()),
|
||||
expectedHash: artifact.digest
|
||||
})
|
||||
|
||||
@@ -161,11 +161,11 @@ jobs:
|
||||
)
|
||||
|
||||
const maintainers = new Set(Object.keys(
|
||||
JSON.parse(await readFile('comparison/maintainers.json', 'utf-8'))
|
||||
JSON.parse(await readFile(`${pull_request.number}/maintainers.json`, 'utf-8'))
|
||||
))
|
||||
|
||||
// And the labels that should be there
|
||||
const after = JSON.parse(await readFile('comparison/changed-paths.json', 'utf-8')).labels
|
||||
const after = JSON.parse(await readFile(`${pull_request.number}/changed-paths.json`, 'utf-8')).labels
|
||||
if (approvals.size > 0) after.push(`12.approvals: ${approvals.size > 2 ? '3+' : approvals.size}`)
|
||||
if (Array.from(maintainers).some(m => approvals.has(m))) after.push('12.approved-by: package-maintainer')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user