skip_changelog: Prefix role label triggers.

Add the prefix `roles/` to the per-role label names in order to
namespace them from other labels.

Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
SuperQ 2023-07-23 11:40:04 +02:00
parent 2d8c557b15
commit 8cad9a6f15
No known key found for this signature in database
GPG key ID: C646B23C9E3245F1
2 changed files with 2 additions and 2 deletions

View file

@ -69,7 +69,7 @@ jobs:
env:
LABELS: ${{ toJson(github.event.pull_request.labels.*.name) }}
run: |
roles=$(echo $LABELS | jq -r '.[]')
roles=$(echo $LABELS | jq -r '.[]' | grep '^roles/' | sed 's|^roles/||')
echo tests="[`for role in $roles; do
for test in $(find tests/integration/targets -maxdepth 1 -mindepth 1 -type d -iname "molecule-${role}-*" -printf "%f\n"); do
echo '{"test":\"'"${test}"'\","name":\"'"${test#*-}\"'"}';

View file

@ -69,7 +69,7 @@ jobs:
steps.changed-roles.outputs.all_changed_and_modified_files
with:
script: |
const labels = '${{ steps.changed-roles.outputs.all_changed_and_modified_files }}'.split(' ');
const labels = '${{ steps.changed-roles.outputs.all_changed_and_modified_files }}'.split(' ').map(i => 'roles/' + i);
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,