Skip to content

Update auto-release.yml #10

Update auto-release.yml

Update auto-release.yml #10

Workflow file for this run

name: Auto Release on '#new-release' commit
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check commit message for '#new-release'
id: check_message
run: |
if git log --format=%B -n 1 | grep -q '#new-release'; then
latest_release=$(git describe --tags --abbrev=0)
new_release=$(echo $latest_release | awk -F. '{$NF = $NF + 1;} 1' OFS=.)
echo "Creating release $new_release"
git tag -a $new_release -m "Release $new_release"
git push origin $new_release
echo "::set-output name=new_release::$new_release"
else
echo "Commit does not include '#new-release'. Skipping release."
exit 0
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |

Check failure on line 35 in .github/workflows/auto-release.yml

View workflow run for this annotation

GitHub Actions / Auto Release on '#new-release' commit

Invalid workflow file

The workflow is not valid. .github/workflows/auto-release.yml (Line: 35, Col: 14): Unexpected symbol: 'new_release#v'. Located at position 29 within expression: steps.check_message.outputs.new_release#v
gh release create "${{ steps.check_message.outputs.new_release }}" \
--repo="$GITHUB_REPOSITORY" \
--title="${{ steps.check_message.outputs.new_release#v }}" \
--generate-notes