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

Read CODE_SCANNING_REF env variable #1368

Merged
merged 1 commit into from
Nov 15, 2022
Merged

Read CODE_SCANNING_REF env variable #1368

merged 1 commit into from
Nov 15, 2022

Conversation

marcogario
Copy link
Contributor

@marcogario marcogario commented Nov 15, 2022

Depending on how we trigger the action run, sometimes the GITHUB_REF is not set.
This seems to be a special variable and we are unable to override it in anyway.

The solution we propose here is to have a dedicated extra environment variable that we can consider.

Why not use the existing params: There is a restriction on the existing ref param that requires the sha to be set. This is not something we need (and it is a stronger requirement than we care about). Moreover, when trying to use these parameters we ran into some warning messages so we are not clear on how well supported they are.

This is the minimal patch that serves our purpose, please provide feedback on how to shape it better.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

@marcogario marcogario requested a review from a team as a code owner November 15, 2022 12:40
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

Looks good.

It would be nice if we had a getOptionalEnvVar function for cases like this. But, this is outside the scope of this PR.

@aeisenberg aeisenberg merged commit 6a0f768 into github:main Nov 15, 2022
@marcogario marcogario deleted the marcogario/code_scanning_ref branch November 15, 2022 17:17
@orhantoy orhantoy mentioned this pull request Dec 13, 2022
3 tasks
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.

4 participants