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:
Wolfgang Walther
2025-06-16 15:57:02 +02:00
parent c12c91f465
commit 7efbed4cd7

View File

@@ -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')