Skip to content

Commit f7c1091

Browse files
committed
feat: add optional pr_owner input to disable auto-commit for bot PRs
Signed-off-by: Nikolai Emil Damm <[email protected]>
1 parent c080147 commit f7c1091

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/ci-go.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: CI - Go
22

33
on:
44
workflow_call:
5+
inputs:
6+
pr_owner:
7+
required: false
8+
type: string
9+
description: "Pull request author login (used to disable auto-commit for bot PRs)"
510
secrets:
611
CODECOV_TOKEN:
712
required: false
@@ -34,7 +39,6 @@ jobs:
3439
with:
3540
app_id: ${{ vars.APP_ID }}
3641
private_key: ${{ secrets.APP_PRIVATE_KEY }}
37-
3842
- name: 📄 Checkout
3943
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4044
with:
@@ -50,6 +54,9 @@ jobs:
5054
run: go mod tidy
5155

5256
- name: 💾 Commit and push applied linter fixes
57+
if: |
58+
!contains(fromJSON('["dependabot[bot]","dependabot","renovate[bot]","renovatebot","renovate"]'), github.event.pull_request.user.login)
59+
&& !contains(fromJSON('["dependabot[bot]","dependabot","renovate[bot]","renovatebot","renovate"]'), inputs.pr_owner)
5360
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
5461
with:
5562
commit_message: "chore: tidy go modules"
@@ -91,6 +98,9 @@ jobs:
9198
args: --fix
9299

93100
- name: 💾 Commit and push applied linter fixes
101+
if: |
102+
!contains(fromJSON('["dependabot[bot]","dependabot","renovate[bot]","renovatebot","renovate"]'), github.event.pull_request.user.login)
103+
&& !contains(fromJSON('["dependabot[bot]","dependabot","renovate[bot]","renovatebot","renovate"]'), inputs.pr_owner)
94104
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
95105
with:
96106
commit_message: "chore: apply golangci-lint fixes"
@@ -182,6 +192,9 @@ jobs:
182192
APPLY_FIXES_MODE: commit
183193

184194
- name: Commit and push applied linter fixes
195+
if: |
196+
!contains(fromJSON('["dependabot[bot]","dependabot","renovate[bot]","renovatebot","renovate"]'), github.event.pull_request.user.login)
197+
&& !contains(fromJSON('["dependabot[bot]","dependabot","renovate[bot]","renovatebot","renovate"]'), inputs.pr_owner)
185198
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
186199
with:
187200
commit_message: "chore: Apply megalinter fixes"

0 commit comments

Comments
 (0)