Skip to content

Commit

Permalink
ci: enable autofix.ci
Browse files Browse the repository at this point in the history
  • Loading branch information
yajo committed Jul 1, 2024
1 parent 798d7aa commit ab81b62
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: autofix.ci # needed to securely identify the workflow

on:
pull_request:
push:
branches: ["master"]
permissions:
contents: read

jobs:
autofix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Install Nix and set up Cachix
- uses: cachix/install-nix-action@V27
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: devenv
name: copier
pushFilter: (-source$|nixpkgs\.tar\.gz$)

# Autoformat and try to push back changes
- run: nix develop --impure -c pre-commit run -a --show-diff-on-failure
continue-on-error: true
# HACK https://github.com/autofix-ci/action/pull/15
- run: nix develop --impure -c pre-commit uninstall -t pre-commit -t commit-msg
- uses: autofix-ci/action@v1.3
with:
commit-message: "style: autoformat with pre-commit"
9 changes: 0 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,6 @@ jobs:
cache-store: "false"
- run: copier --version

# Autoformat and try to push back changes
- run: pre-commit run -a
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v5
continue-on-error: true
with:
commit_message: "style: autoformat with pre-commit"
commit_options: --no-verify

# Run nix checks
- run: nix flake check -L --accept-flake-config --impure

Expand Down

0 comments on commit ab81b62

Please sign in to comment.