- Notifications
You must be signed in to change notification settings - Fork428
FavorGITHUB_WORKFLOW_REF over usingactions: read to calculate the workflow path#2126
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -121,25 +121,12 @@ export async function getGitHubVersion(): Promise<GitHubVersion> { | ||
| * Get the path of the currently executing workflow relative to the repository root. | ||
| */ | ||
| export async function getWorkflowRelativePath(): Promise<string> { | ||
| const workflow_ref = process.env["GITHUB_WORKFLOW_REF"]; | ||
github-advanced-security[bot] marked this conversation as resolved. FixedShow fixedHide fixedUh oh!There was an error while loading.Please reload this page. Check warningCode scanning / CodeQL Some environment variables may not exist in default setup workflows The environment variable GITHUB_WORKFLOW_REF may not exist in default setup workflows. If all uses are safe, add it to the list of environment variables that are known to be safe in 'queries/default-setup-environment-variables.ql'. If this use is safe but others are not, dismiss this alert as a false positive. | ||
| const workflowRegExp = new RegExp("^[^/]+/[^/]+/(.*?)@.*"); | ||
| const match = workflow_ref?.match(workflowRegExp); | ||
| return new Promise((resolve) => { | ||
| resolve(match ? match[1] : ''); | ||
| }); | ||
| } | ||
| /** | ||