From 6dd937678af792fc9314c168d8371234075e6e7b Mon Sep 17 00:00:00 2001 From: gardar Date: Thu, 17 Oct 2024 17:40:06 +0000 Subject: [PATCH] skip_changelog(ci): fix: ensure all roles are tested when _common role is changed Signed-off-by: gardar --- .github/workflows/conventional-label.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/conventional-label.yml b/.github/workflows/conventional-label.yml index 7d109801..cd83e63b 100644 --- a/.github/workflows/conventional-label.yml +++ b/.github/workflows/conventional-label.yml @@ -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,