Skip to content

Commit

Permalink
Try contructing lists differently
Browse files Browse the repository at this point in the history
  • Loading branch information
desertaxle committed Jun 28, 2024
1 parent ef04f06 commit 30be8da
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/label-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@ jobs:
- name: Get required labels from release.yml
id: get-required-labels
run: |
labels=$(yq e '.changelog.categories[] | select(.title != "Uncategorized") | .labels[]' .github/release.yml | tr '\n' ' ')
labels=()
for label in $(yq -r '.changelog.categories[] | select(.title != "Uncategorized") | .labels[]' .github/release.yml); do
labels+=("$label")
done
echo "required_labels=$labels" >> $GITHUB_OUTPUT
- name: Get PR labels
id: get-pr-labels
run: |
labels=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH")
labels=()
for label in $(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH" | tr '\n' ' '); do
labels+=("$label")
done
echo "labels=$labels" >> $GITHUB_OUTPUT
- name: Check for specific labels
Expand All @@ -40,10 +46,6 @@ jobs:
required_labels="${{ steps.get-required-labels.outputs.required_labels }}"
pr_labels="${{ steps.get-pr-labels.outputs.labels }}"
# Convert newline-separated strings into arrays
readarray -t required_labels_array <<< "$required_labels"
readarray -t pr_labels_array <<< "$pr_labels"
found=false
for required_label in "${required_labels_array[@]}"; do
for pr_label in "${pr_labels_array[@]}"; do
Expand Down

0 comments on commit 30be8da

Please sign in to comment.