Skip to content

Merge pull request #86 from KrishnaswamyLab/minor-prerelease #103

Merge pull request #86 from KrishnaswamyLab/minor-prerelease

Merge pull request #86 from KrishnaswamyLab/minor-prerelease #103

Workflow file for this run

name: pre-commit

Check failure on line 1 in .github/workflows/pre-commit.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/pre-commit.yml

Invalid workflow file

(Line: 11, Col: 3): Unexpected value 'workflows'
on:
push:
branches-ignore:
- 'master'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: write
workflows: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-latest
if: >-
!endsWith(github.event.head_commit.message, '# ci skip') &&
(
startsWith(github.ref, 'refs/heads') ||
github.event.pull_request.draft == false
)
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}-
- name: Run pre-commit
id: precommit
uses: pre-commit/[email protected]
continue-on-error: true
- name: Commit files
if: steps.precommit.outcome == 'failure' && startsWith(github.ref, 'refs/heads')
run: |
if [[ `git status --porcelain --untracked-files=no` ]]; then
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git checkout -- .github/workflows
git commit -m "pre-commit" -a
fi
shell: bash -ex {0}
- name: Push changes
if: steps.precommit.outcome == 'failure' && startsWith(github.ref, 'refs/heads')
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Check pre-commit
if: steps.precommit.outcome == 'failure'
uses: pre-commit/[email protected]