Skip to content

Commit

Permalink
arrays are hard
Browse files Browse the repository at this point in the history
  • Loading branch information
desertaxle committed Jun 28, 2024
1 parent bfb9ca3 commit fcc00e9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/label-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ jobs:
for label in $(yq -r '.changelog.categories[] | select(.title != "Uncategorized") | .labels[]' .github/release.yml); do
labels+=("$label")
done
echo "Required labels: $labels"
echo "required_labels=$labels" >> $GITHUB_OUTPUT
labels_string=$(IFS=, ; echo "${labels[*]}")
echo "Required labels: $labels_string"
echo "required_labels=$labels_string" >> $GITHUB_OUTPUT
- name: Get PR labels
id: get-pr-labels
Expand All @@ -39,15 +42,21 @@ jobs:
for label in $(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH"); do
labels+=("$label")
done
echo "PR labels: $labels"
echo "labels=$labels" >> $GITHUB_OUTPUT
labels_string=$(IFS=, ; echo "${labels[*]}")
echo "PR labels: $labels_string"
echo "labels=$labels_string" >> $GITHUB_OUTPUT
- name: Check for specific labels
id: check-label
run: |
required_labels="${{ steps.get-required-labels.outputs.required_labels }}"
pr_labels="${{ steps.get-pr-labels.outputs.labels }}"
IFS=',' read -r -a required_labels_array <<< "$required_labels"
IFS=',' read -r -a 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 fcc00e9

Please sign in to comment.