fix: Granting release workflow write permissions #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Action | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
name: Create Action Release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Bump version tag | |
id: tag | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ github.token }} | |
commit_sha: ${{ github.sha }} | |
- name: Update MAJOR and MINOR tags | |
shell: bash | |
env: | |
VERSION: ${{ steps.tag.outputs.new_version }} | |
run: | | |
MAJOR=$(echo "$VERSION" | cut -d . -f 1) | |
MINOR=$(echo "$VERSION" | cut -d . -f 2) | |
git tag -f v$MAJOR | |
git tag -f v$MAJOR.$MINOR | |
git push -f -u origin v$MAJOR | |
git push -f -u origin v$MAJOR.$MINOR |