Skip to content

Merge pull request #2 from gmmcal/make-more-reusable #8

Merge pull request #2 from gmmcal/make-more-reusable

Merge pull request #2 from gmmcal/make-more-reusable #8

Workflow file for this run

name: Tag Release
on:
push:
branches:
- main
jobs:
tag:
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: main
majorList: "BREAK"
minorList: "NEW"
patchList: "FIX,OPT"
- name: 🏷️ Create tag ${{ steps.semver.outputs.next }}
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.semver.outputs.next }}',
sha: context.sha
})
- name: 🏷️ Create/update tag ${{ steps.semver.outputs.nextMajor }}
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/${{ steps.semver.outputs.nextMajor }}',
sha: context.payload.after
}).catch(err => {
if (err.status !== 422) throw err;
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/${{ steps.semver.outputs.nextMajor }}',
sha: context.payload.after
});
})