Skip to content

Merge pull request #4 from 7Factor/jwood/no_token #4

Merge pull request #4 from 7Factor/jwood/no_token

Merge pull request #4 from 7Factor/jwood/no_token #4

Workflow file for this run

name: Create Release Version
on:
push:
branches:
- main
jobs:
release_on_push:
runs-on: ubuntu-latest
steps:
- name: Create release
id: create-release
uses: rymndhng/release-on-push-action@v0.25.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
bump_version_scheme: norelease
tag_prefix: v
release_name: "Release <RELEASE_VERSION>"
- name: Output version parts
id: version-parts
env:
version: ${{ steps.create-release.outputs.tag_name }}
run: |
clean_version=${version#v}
echo "major=$(echo $clean_version | cut -d. -f1)" >> $GITHUB_OUTPUT
echo "minor=$(echo $clean_version | cut -d. -f2)" >> $GITHUB_OUTPUT
echo "patch=$(echo $clean_version | cut -d. -f3)" >> $GITHUB_OUTPUT
- name: Update major version tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v${{ steps.version-parts.outputs.major }}',
sha: context.sha
}).catch(err => {
if (err.status !== 422) throw err;
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/v${{ steps.version-parts.outputs.major }}',
sha: context.sha
});
});
- name: Update minor version tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v${{ steps.version-parts.outputs.major }}.${{ steps.version-parts.outputs.minor }}',
sha: context.sha
}).catch(err => {
if (err.status !== 422) throw err;
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/v${{ steps.version-parts.outputs.major }}.${{ steps.version-parts.outputs.minor }}',
sha: context.sha
});
});