Skip to content

Commit

Permalink
Have pre-commit bootstrap go so that GitHub actions don't need to (#21)
Browse files Browse the repository at this point in the history
It looks like GitHub actions only use go 1.20 by default, so anyone
using keep-sorted via the GitHub action pre-commit would need to
separately install go 1.21. It looks like pre-commit can do that for us
automatically.

See #18 (comment)
for more details

Tested in a child PR #22
  • Loading branch information
JeffFaer committed Feb 6, 2024
1 parent e1b107b commit dcb7a03
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.21"
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
11 changes: 8 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ repos:
hooks:
- id: keep-sorted
name: keep-sorted
language: system
entry: go
args: [run, .]
language: golang
# Remember to also update language_version in .pre-commit-hooks.yaml!
language_version: 1.21.6
entry: go run .
- repo: https://github.com/pre-commit/pre-commit
rev: v3.6.0
hooks:
- id: validate_manifest
1 change: 1 addition & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
- id: keep-sorted
name: keep-sorted
language: golang
language_version: 1.21.6
entry: keep-sorted

0 comments on commit dcb7a03

Please sign in to comment.