Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorcast-db committed Jul 9, 2024
1 parent 1cc6fee commit dd9618f
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@ jobs:

commit-message:
runs-on: ubuntu-latest

if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Validate Tag
run: |
MSG=$(git log --format=%B -n 1 ${{github.event.after}})
TAG=$(echo MSG | sed 's/\[\(.*\)\].*/\1/')
MSG=$(git log --format=%B -n 1 ${{ github.event.pull_request.title }})
TAG=$(echo $MSG | sed -ne 's/\[\(.*\)\].*/\1/p')
echo "Found tag {$TAG}"
LINE=$(cat .codegen/changelog_config.yml | grep "tag: \"\[$(echo $TAG)\]\"")
VALID=$([ -z "$TAG" ] && echo "False" || echo "True")
echo "::set-env name=VALID_TAG::${TAG}"
- name: Valid Tag
if: ${{VALID}} != "true"
uses: actions/github-script@v3
with:
script: |
core.setFailed('Invalid tag name')
# Store in variable to hide the result from the console output
MATCH=$(cat .codegen/changelog_config.yml | grep "tag: \"\[$(echo $TAG)\]\"")
- name: Log failure
if: failure()
run: |
echo "Invalid or missing tag in commit message"
exit 1

0 comments on commit dd9618f

Please sign in to comment.