Skip to content

Commit

Permalink
Auto publish on version commit title
Browse files Browse the repository at this point in the history
  • Loading branch information
JovannMC committed Apr 13, 2024
1 parent ca1277f commit de1d552
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,26 @@ name: Node.js Package
on:
release:
types: [created]
push:
branches:
- '**'
paths-ignore:
- '**.md'
tags:
- 'v*.*.*'

jobs:
check-title:
runs-on: ubuntu-latest
steps:
- name: Check commit title
run: |
commit_title=$(git log --format=%s -n 1 ${{ github.event.after }})
if [[ ! "$commit_title" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "Commit title '$commit_title' doesn't start with a semantic version number. Cancelling workflow."
exit 1
fi
build:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit de1d552

Please sign in to comment.