Skip to content

Require version in main branch with -pre suffix #1

Require version in main branch with -pre suffix

Require version in main branch with -pre suffix #1

name: Main branch with pre-version
on:
pull_request:
branches:
- main
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout Actions
uses: actions/checkout@v4
- name: Get version
id: get_version
run: |
echo "::set-output name=version::$(cat package.json | jq -r '.version')"
- name: Fail
if: '${{ !endsWith(steps.get_version.outputs.version, "-pre") }}'

Check failure on line 18 in .github/workflows/pr-require-pre-version.yml

View workflow run for this annotation

GitHub Actions / Main branch with pre-version

Invalid workflow file

The workflow is not valid. .github/workflows/pr-require-pre-version.yml (Line: 18, Col: 13): Unexpected symbol: '"-pre"'. Located at position 46 within expression: !endsWith(steps.get_version.outputs.version, "-pre")
run: |
echo "The version specific in the package.json must have `-pre` as suffix for the main branch."
exit 1