Skip to content

fix: fail github workflow job if checkPhase failed #65

fix: fail github workflow job if checkPhase failed

fix: fail github workflow job if checkPhase failed #65

# yamllint disable rule:line-length
---
name: Build Artifacts
on:
push:
branches: [main]
paths-ignore: ["*.md"]
pull_request:
branches: [main]
paths-ignore: ["*.md"]
jobs:
Compile-All:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
- name: Compile TextMate Grammar
run: |
set +e
chmod +x ./scripts/compile-grammar.sh
./scripts/compile-grammar.sh
exitcode="$?"
echo "exitcode=$exitcode" >> $GITHUB_OUTPUT
exit "$exitcode"
shell: bash
- name: Compile Coverage Badge SVG
run: |
sudo apt-get install -y xsltproc
make -B $(pwd)/images/coverage-badge.svg
shell: bash
- name: Import GPG key
id: import-gpg
uses: crazy-max/[email protected]
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: GPG user
run: |
echo "fingerprint: ${{ steps.import-gpg.outputs.fingerprint }}"
echo "username: ${{ steps.import-gpg.outputs.name }}"
echo "email: ${{ steps.import-gpg.outputs.email }}"
shell: bash
- name: Auto-commit changes
id: auto-commit-action
uses: stefanzweifel/[email protected]
with:
commit_message: auto-commit of artifacts
branch: main
commit_options: '-S'
file_pattern: 'syntaxes/* images/*'
commit_author: ${{ steps.import-gpg.outputs.name }} <${{ steps.import-gpg.outputs.email }}>
commit_user_name: ${{ steps.import-gpg.outputs.name }}
commit_user_email: ${{ steps.import-gpg.outputs.email }}
- name: Run if changes have been detected
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: echo "New TextMate grammar was published"
shell: bash