ci(ipa): use release tags for IPA ruleset #52
Workflow file for this run
This file contains hidden or 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: IPA Changelog Check | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, edited] | |
| paths: | |
| - 'tools/spectral/ipa/package.json' | |
| jobs: | |
| check-changelog: | |
| 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 | |
| env: | |
| BASE_BRANCH: ${{ github.event.pull_request.base.ref }} | |
| run: | | |
| version_changed=$(./.github/scripts/ipa_version_check.sh) | |
| echo "Version changed? ${version_changed}" | |
| echo "version_changed=${version_changed}" >> "${GITHUB_OUTPUT}" | |
| - name: Check Changelog | |
| working-directory: tools/spectral/ipa | |
| env: | |
| VERSION_BUMP: ${{ steps.version_check.outputs.version_changed }} | |
| run: | | |
| npm run gen-ipa-changelog | |
| # Check for uncommitted changes specific to CHANGELOG.md | |
| uncommitted_changes=$(git status --porcelain | grep "CHANGELOG.md" || echo "") | |
| diff_changelog=$(git diff -- tools/spectral/ipa/CHANGELOG.md || echo "") | |
| if [[ "${VERSION_BUMP}" == "false" && -n "${uncommitted_changes}" ]]; then | |
| echo "Error: Changelog should only be updated alongside a version bump. Please restore the changelog." | |
| exit 1 | |
| fi | |
| if [[ "${VERSION_BUMP}" == "true" && -n "${diff_changelog}" ]]; then | |
| echo "Error: Changelog must be updated alongside a version bump. Please run 'npm run gen-ipa-changelog' from the ipa directory and commit the changes." | |
| exit 1 | |
| fi | |
| exit 0 |