Skip to content

Update auto-release.yml #8

Update auto-release.yml

Update auto-release.yml #8

Workflow file for this run

name: Auto Release on 'new-release' commit
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Check commit message for '#new-release'
run: |
commit_message=$(git log --format=%B -n 1)
if echo "$commit_message" | grep -q '#new-release'; then
if [[ "$commit_message" =~ <new-release:([^>]+)> ]]; then
new_release="${BASH_REMATCH[1]}"
echo "Creating release $new_release"
git config --global user.name 'GitHub Actions Bot'
git config --global user.email '<>'
git tag -a "$new_release" -m "Release $new_release"
git push origin "$new_release"
else
echo "Commit includes '#new-release' but no tag found in <new-release:tag> format. Skipping release."
exit 1
fi
else
echo "Commit does not include '#new-release'. Skipping release."
exit 0
fi