-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename check release notes action to check labels and add validation …
…to enforce adding a valid label
- Loading branch information
Showing
3 changed files
with
46 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Check Labels | ||
|
||
# Every PR should have a label and some labels should include an update to the release notes | ||
on: | ||
pull_request: | ||
branches-ignore: | ||
- 'main' | ||
types: [ synchronize, labeled, unlabeled ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
labels-check: | ||
# https://github.com/actions/virtual-environments/ | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check PR labels | ||
run: | | ||
all_pr_labels= gh pr view --json labels --jq '.labels[].name' | ||
echo $all_pr_labels | ||
if contains($all_pr_labels, 'Breaking change') || contains($all_pr_labels, 'Feature') || contains($all_pr_labels, 'Fix') | ||
then | ||
git fetch origin develop --depth 1 | ||
if [ -n "$(git diff origin/develop RELEASE_NOTES.md)" ] | ||
then | ||
echo "RELEASE_NOTES.md was updated" | ||
exit 0 | ||
else | ||
echo "::error::Add release notes for your PR by updating RELEASE_NOTES.md" | ||
exit 1 | ||
fi | ||
if contains($all_pr_labels, 'Dependencies') || contains($all_pr_labels, 'Chore') | ||
then | ||
echo "No extra actions needed for used labels" | ||
exit 0 | ||
fi | ||
echo "::error::You must add a valid label to this PR" | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.