Skip to content

Fix refs used for code scanning results #1346

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

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Jun 14, 2024

There are two changes here:

  • When invoking the static analysis job from the release job, the github.ref variable is set to the branch that the release workflow was triggered in. This is changed to the tag reference we just created.
  • The code scanning export action was invoked with the same github.ref, which was also changed to using the ref of the newly created tag.

@alcaeus alcaeus requested a review from jmikola June 14, 2024 10:39
@alcaeus alcaeus self-assigned this Jun 14, 2024
@alcaeus alcaeus requested a review from a team as a code owner June 14, 2024 10:39
@alcaeus
Copy link
Member Author

alcaeus commented Jun 14, 2024

I'll have to revisit this as apparently just passing the ref input is not sufficient, but we don't have the sha input when releasing.

@jmikola jmikola self-requested a review June 14, 2024 18:21
@alcaeus alcaeus force-pushed the fix-sarif-release-upload branch 3 times, most recently from aeacaf8 to 849fe0e Compare June 17, 2024 07:44
@alcaeus alcaeus force-pushed the fix-sarif-release-upload branch from 849fe0e to 155bd70 Compare June 17, 2024 07:56
sha: ${{ github.event_name == 'workflow_dispatch' && env.CHECKED_OUT_SHA || github.sha }}

- name: "Upload SARIF report"
if: ${{ github.event_name != 'workflow_dispatch' }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to split this, as the upload-sarif action contains logic to fix the refs/pulls/<number>/merge ref, but doesn't do so when it was provided explicitly. Thus the only way to retain current logic for pull requests is to invoke the action without ref and sha arguments, and then explicitly pass them when the workflow was dispatched manually.

@alcaeus alcaeus force-pushed the fix-sarif-release-upload branch from 155bd70 to f7bb2a6 Compare June 17, 2024 08:33
@alcaeus alcaeus merged commit a703674 into mongodb:v1.19 Jun 18, 2024
25 of 27 checks passed
@alcaeus alcaeus deleted the fix-sarif-release-upload branch June 18, 2024 06:44
@alcaeus
Copy link
Member Author

alcaeus commented Jun 18, 2024

Note: ignored failing evergreen variants, as they're related to a newer PHPC version.

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.

2 participants