Require version in main branch with -pre suffix #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 GitHub Actions / Main branch with pre-versionInvalid workflow file
|
||
run: | | ||
echo "The version specific in the package.json must have `-pre` as suffix for the main branch." | ||
exit 1 | ||