Skip to content

chore: allow pre major versions to bump patch (#20) #9

chore: allow pre major versions to bump patch (#20)

chore: allow pre major versions to bump patch (#20) #9

Workflow file for this run

name: Changelog

Check failure on line 1 in .github/workflows/changelog.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/changelog.yml

Invalid workflow file

(Line: 58, Col: 14): Unexpected symbol: '.version'. Located at position 52 within expression: fromJson(steps.release-please.outputs.releases).'.'.version
on:
workflow_dispatch:
push:
branches:
# for prod releases
- main
# for hotfixes
- release/*
env:
HUSKY: 0 # https://typicode.github.io/husky/how-to.html#ci-server-and-docker
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
contents: write
issues: write
pull-requests: write
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Determine release config based on branch
id: config_filename
env:
DEFAULT_RELEASE_CONFIG_FILE: release-please-config.json
HOTFIX_RELEASE_CONFIG_FILE: release-please-config.hotfix.json
run: |
case "${{ github.ref_name }}" in
release/*)
echo "config_filename=${HOTFIX_RELEASE_CONFIG_FILE}" >> $GITHUB_OUTPUT
echo "mode=hotfix" >> $GITHUB_OUTPUT
;;
*)
echo "config_filename=${DEFAULT_RELEASE_CONFIG_FILE}" >> $GITHUB_OUTPUT
echo "mode=feature" >> $GITHUB_OUTPUT
;;
esac
- uses: googleapis/release-please-action@v4
id: release-please
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: ".github/${{ steps.config_filename.outputs.config_filename }}"
manifest-file: ".github/release-please-manifest.json"
target-branch: "${{ github.ref_name }}"
- name: Create snapshot branch
if: steps.release-please.outputs.releases_created == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b snapshot/${{ fromJson(steps.release-please.outputs.releases).'.'.version }}
git push origin snapshot/${{ fromJson(steps.release-please.outputs.releases).'.'.version }}