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

🐛 Surface workflow verification errors with doc link #408

Merged

Conversation

spencerschrock
Copy link
Member

Should resolve ossf/scorecard-action#1150 once a new webapp release is cut. The underlying logic always existed for POST requests, but the implementation wasn't working due to a %v instead of a %w here:

// Verify scorecard workflow.
if err := verifyScorecardWorkflow(workflowContent); err != nil {
return fmt.Errorf("workflow could not be verified: %v", err)
}

After testing locally, I received the following response to the issue reporter's POST data:

{
  "code": 400,
  "message": "workflow verification failed: workflow contains global env vars or defaults, see https://github.com/ossf/scorecard-action#workflow-restrictions for details."
}

Signed-off-by: Spencer Schrock <sschrock@google.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
Signed-off-by: Spencer Schrock <sschrock@google.com>
This lets us better control which errors we surface as a 400 vs hide as 500.

Signed-off-by: Spencer Schrock <sschrock@google.com>
@netlify
Copy link

netlify bot commented Jun 5, 2023

Deploy Preview for ossf-scorecard canceled.

Name Link
🔨 Latest commit 4428c6e
🔍 Latest deploy log https://app.netlify.com/sites/ossf-scorecard/deploys/647e2d2f5d7cca0008054696

@spencerschrock spencerschrock merged commit 779d43c into ossf:main Jun 7, 2023
@spencerschrock spencerschrock deleted the fix/workflow-verification-error branch June 7, 2023 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing the workflow file from the "expected" contents should provide a more helpful error, be documented
2 participants