Skip to content

v2.0.0

v2.0.0 #2

name: Create Major Branch
on:
release:
types: [released]
jobs:
create:
name: Create major version branch
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Push HEAD to major version branch
run: |
major="$(echo '${{ github.event.release.tag_name }}' | sed -E 's/(v[0-9]+)\..+/\1/')"
if [ '${{ github.event.release.tag_name }}' != "$major" ]; then
git push --force origin "HEAD:refs/heads/$major"
fi