File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -477,9 +477,18 @@ func buildEntry() *cobra.Command {
477
477
}
478
478
479
479
publishArtefacts , err := func () (bool , error ) {
480
+ // https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#responding-to-events
481
+ isDependabot := os .Getenv ("GITHUB_ACTOR" ) == "dependabot[bot]"
482
+
480
483
event := os .Getenv ("GITHUB_EVENT_NAME" )
481
484
switch event {
482
485
case "push" :
486
+ if isDependabot { // one would imagine these would be PR events, but dependabot can cause pushes too ..
487
+ // .. and as such shouldn't cause artefacts to be published (secrets aren't even accessible,
488
+ // and publishing often requires secrets)
489
+ return false , nil
490
+ }
491
+
483
492
return true , nil
484
493
case "pull_request" : // PRs don't publish artefacts
485
494
return false , nil
You can’t perform that action at this time.
0 commit comments