Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Add bash action for matching semver label (#54)
Browse files Browse the repository at this point in the history
* Add match-label-action

* Rename step id

* Now with label

* Fix allowed values

* Add bash action for matching semver label

* Change to new line according to https://github.com/actions-ecosystem/action-get-merged-pull-request?tab=readme-ov-file#outputs
  • Loading branch information
dwendland authored Mar 20, 2024
1 parent 0797490 commit 9374d84
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/release-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,24 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- id: match-label
uses: zwaldowski/match-label-action@v1
with:
allowed: major, minor, patch

- name: Match semver label via bash
id: match-label-bash
run: |
LABELS=${{ steps.pr.outputs.labels }}
IFS='\n' read -ra LABEL <<< "$LABELS"
for i in "${LABEL[@]}"; do
case $i in
# Will just use the first occurence
'major'|'minor'|'patch')
echo "RELEASE_LABEL=$i" >> $GITHUB_OUTPUT
break
esac
done
- uses: zwaldowski/semver-release-action@v2
with:
dry_run: true
bump: ${{ steps.match-label.outputs.match }}
bump: ${{ steps.match-label-bash.outputs.RELEASE_LABEL }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Set version output
Expand Down

0 comments on commit 9374d84

Please sign in to comment.