Merge pull request #429 from gardar/ci/_common-label

skip_changelog(ci): fix: ensure all roles are tested when _common role is changed
This commit is contained in:
gardar 2024-10-17 17:50:00 +00:00 committed by GitHub
commit 90ab1fbc33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,7 +73,18 @@ jobs:
steps.changed-roles.outputs.all_changed_and_modified_files
with:
script: |
const labels = '${{ steps.changed-roles.outputs.all_changed_and_modified_files }}'.split(' ').map(i => 'roles/' + i);
const changedRoles = '${{ steps.changed-roles.outputs.all_changed_and_modified_files }}'.split(' ');
let labels = changedRoles.map(i => 'roles/' + i);
if (changedRoles.includes('_common')) {
const allLabels = await github.paginate(github.rest.issues.listLabelsForRepo, {
owner: context.repo.owner,
repo: context.repo.repo,
});
const roleLabels = allLabels.map(label => label.name).filter(name => name.startsWith('roles/'));
labels = [...new Set([...labels, ...roleLabels])];
}
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,