This repository was archived by the owner on Oct 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d49966
commit b50c112
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: pre-commit | ||
|
||
on: | ||
push: | ||
branches: | ||
- renovate/* | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5 | ||
with: | ||
# NOTE(chrisgacsal): Use actions/cache for caching Go dependency and build caches | ||
# as if provides better flexibility like setting the cache key which reduces cache misses significantly. | ||
cache: false | ||
go-version-file: '.go-version' | ||
|
||
- name: Setup Go caching | ||
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ github.ref_name }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-${{ github.ref_name }}- | ||
${{ runner.os }}-go-${{ github.event.repository.default_branch }}- | ||
- name: Fix code | ||
run: | | ||
make gomod-tidy | ||
make fix | ||
- name: Commit changes | ||
run: | | ||
git config --global user.name 'OpenClarity Bot' | ||
git config --global user.email '[email protected]' | ||
git commit -am "chore: fix renovate changes" | ||
git push |