File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 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 {
477477 }
478478
479479 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+
480483 event := os .Getenv ("GITHUB_EVENT_NAME" )
481484 switch event {
482485 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+
483492 return true , nil
484493 case "pull_request" : // PRs don't publish artefacts
485494 return false , nil
You can’t perform that action at this time.
0 commit comments