Skip to content

Commit

Permalink
Using actions-ecosystem/action-release-label to get label state in ch…
Browse files Browse the repository at this point in the history
…eck-for-release-tag workflow.
  • Loading branch information
DevOpsDave committed Jan 10, 2024
1 parent efc9d61 commit fc54fbd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/check-for-release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ jobs:
ref: master
path: ./masterbranch

- name: Get release label
uses: actions-ecosystem/action-release-label@v1
id: release-label

- name: Verify that a release label exists on the PR
if: ${{ ! ( contains(github.event.pull_request.labels.*.name, 'release/patch') || contains(github.event.pull_request.labels.*.name, 'release/minor') || contains(github.event.pull_request.labels.*.name, 'release/major') || contains(github.event.pull_request.labels.*.name, 'release/skip') ) }}
#if: ${{ ! ( contains(github.event.pull_request.labels.*.name, 'release/patch') || contains(github.event.pull_request.labels.*.name, 'release/minor') || contains(github.event.pull_request.labels.*.name, 'release/major') || contains(github.event.pull_request.labels.*.name, 'release/skip') ) }}
if: ${{ ! ( steps.release-label.outputs.level == null ) }}}
run: echo "Please label your PR with a release label" && exit 1

# ensure changelog.txt has been updated in this PR by comparing it to the one in the master branch
- name: Verify that changelog.txt has been updated
if: ${{ contains(github.event.pull_request.labels.*.name, 'release/patch') || contains(github.event.pull_request.labels.*.name, 'release/minor') || contains(github.event.pull_request.labels.*.name, 'release/major') }}
run: |
! cmp --silent <(tail -n+2 changelog.txt) <(tail -n+2 ./masterbranch/changelog.txt) || { echo 'Changelog.txt must be updated for release PRs. Please update changelog.txt' && exit 1 ; }
#- name: Verify that changelog.txt has been updated
# if: ${{ contains(github.event.pull_request.labels.*.name, 'release/patch') || contains(github.event.pull_request.labels.*.name, 'release/minor') || contains(github.event.pull_request.labels.*.name, 'release/major') }}
# run: |
# ! cmp --silent <(tail -n+2 changelog.txt) <(tail -n+2 ./masterbranch/changelog.txt) || { echo 'Changelog.txt must be updated for release PRs. Please update changelog.txt' && exit 1 ; }

0 comments on commit fc54fbd

Please sign in to comment.