Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Disable pull_request_target #1031

Merged
merged 6 commits into from Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion main.go
Expand Up @@ -24,6 +24,11 @@ import (
)

func main() {
triggerEventName := os.Getenv("GITHUB_EVENT_NAME")
if triggerEventName == "pull_request_target" {
log.Fatalf("pull_request_target trigger is not supported")
}

action, err := entrypoint.New()
if err != nil {
log.Fatalf("creating scorecard entrypoint: %v", err)
Expand All @@ -35,7 +40,7 @@ func main() {

if os.Getenv(options.EnvInputPublishResults) == "true" &&
// `pull_request` do not have the necessary `token-id: write` permissions.
os.Getenv("GITHUB_EVENT_NAME") != "pull_request" {
triggerEventName != "pull_request" {
// Get json results by re-running scorecard.
jsonPayload, err := signing.GetJSONScorecardResults()
if err != nil {
Expand Down

This file was deleted.

72 changes: 0 additions & 72 deletions starter-workflows/code-scanning/scorecards.yml

This file was deleted.