Skip to content

Commit 474ead4

Browse files
chore(ci): run pre-commit on smaller box (#261)
1 parent e6b02f5 commit 474ead4

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/pre-commit.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@ on:
1010

1111
jobs:
1212
pre-commit:
13-
# changing the following value will significantly affect github's cost. Be careful and consult with the team before changing it.
14-
runs-on: ubuntu-latest-8
13+
runs-on: ubuntu-latest
1514
timeout-minutes: 10
16-
permissions:
17-
# Give the default GITHUB_TOKEN write permission to commit and push the
18-
# added or changed files to the repository.
19-
contents: write
2015

2116
steps:
2217
- name: Check out the repo
@@ -26,8 +21,10 @@ jobs:
2621
repository: ${{ github.event.pull_request.head.repo.full_name }}
2722
ref: ${{ github.event.pull_request.head.ref }}
2823
token: ${{ secrets.REPO_SCOPED_TOKEN }}
24+
2925
- name: Setup backend
3026
uses: ./.github/actions/setup-backend
27+
3128
- name: Setup-pre-commit
3229
run: uv tool install pre-commit --with pre-commit-uv --force-reinstall
3330

@@ -36,13 +33,15 @@ jobs:
3633
path: ~/.cache/pre-commit
3734
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
3835
restore-keys: pre-commit
36+
3937
- run: uv run --frozen pre-commit run --show-diff-on-failure --color=always --all-files --source ${{ github.event.pull_request.base.sha }} --origin ${{github.event.pull_request.head.sha }}
4038
shell: bash
4139
env:
4240
SKIP: disallowed-words-check,circleci_validate
41+
4342
- uses: stefanzweifel/git-auto-commit-action@v5
4443
# Always commit changes even if pre-commit failed
45-
if: always()
44+
if: always() && github.event_name == 'pull_request'
4645
with:
4746
commit_message: "Automated pre-commit update"
4847
push_options: "--no-verify"

0 commit comments

Comments
 (0)