Skip to content

Commit

Permalink
Fixing logic in check for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
DevOpsDave committed Jan 10, 2024
1 parent e2d3ea4 commit 4f0f163
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions .github/workflows/check-for-release-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,6 @@ jobs:
runs-on: ubuntu-latest

steps:
# trivial
# Comment out checkouts since we are not checking for the changelog.txt
#- uses: actions/checkout@v2

# checkout the master branch to compare changelog.txt
#- uses: actions/checkout@v2
# with:
# ref: master
# path: ./masterbranch

- name: Get release label
uses: actions-ecosystem/[email protected]
id: release-label
Expand All @@ -28,13 +18,7 @@ jobs:

- run: echo "Release level is ${{ steps.release-label.outputs.level }}"

- name: Fail if label does not exist
- name: Fail if label does not exist, or skip if release/skip label exists
#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 ) && ( ! contains(github.event.pull_request.labels.*.name, 'release/skip') ) }}
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 ; }
if: ${{ ( steps.release-label.outputs.level == null ) || ( ! contains(github.event.pull_request.labels.*.name, 'release/skip') ) }}
run: echo "Please label your PR with a release label" && exit 1

0 comments on commit 4f0f163

Please sign in to comment.