Skip to content

Add if to check version change status before publishing #3

Add if to check version change status before publishing

Add if to check version change status before publishing #3

Workflow file for this run

name: Release IPA Package

Check failure on line 1 in .github/workflows/ipa-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ipa-release.yml

Invalid workflow file

(Line: 43, Col: 9): Unrecognized named-value: 'env'. Located at position 1 within expression: env.version_changed == 'true'
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'tools/spectral/ipa/package.json'
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
sparse-checkout: |
tools/spectral/ipa
.github/scripts
- name: Fetch Versions
id: version_check
run: |
chmod +x ./.github/scripts/ipa_version_check.sh
version_changed=$(./.github/scripts/ipa_version_check.sh)
echo "Version changed? ${version_changed}"
echo "version_changed=${version_changed}" >> "${GITHUB_ENV}"
- name: Check Version Bump
run: |
if [[ "${{ env.version_changed }}" == "false" ]]; then
echo "No version bump to release."
exit 0
fi
publish:
needs: check-version
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
if: ${{ env.version_changed == 'true' }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
working-directory: tools/spectral/ipa
- run: npm publish --access public
working-directory: tools/spectral/ipa
env:
NODE_AUTH_TOKEN: ${{ secrets.IPA_VALIDATION_TOKEN }}