Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb66391a

Browse files
committed
Favor GITHUB_WORKFLOW_REF
Introduced with GHES 3.9:https://docs.github.com/en/enterprise-server@3.9/actions/learn-github-actions/variablesGITHUB_WORKFLOW_REF means that actions don't need to use `actions: read`to determine the path to the running workflow.
1 parentc79c360 commitb66391a

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the
88

99
- Update default CodeQL bundle version to 2.16.2.[#2124](https://github.com/github/codeql-action/pull/2124)
1010
- The CodeQL action no longer fails if it can't write to the telemetry api endpoint.[#2121](https://github.com/github/codeql-action/pull/2121)
11+
- Users of GHES3.9+ and GHEC will no longer need to include`actions: read` permissions to use`upload-sarif` in private repositories.
1112

1213
##3.24.0 - 02 Feb 2024
1314

‎lib/api-client.js‎

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎lib/api-client.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎src/api-client.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,18 @@ export async function getGitHubVersion(): Promise<GitHubVersion> {
119119
* Get the path of the currently executing workflow relative to the repository root.
120120
*/
121121
exportasyncfunctiongetWorkflowRelativePath():Promise<string>{
122+
constworkflow_ref=process.env["GITHUB_WORKFLOW_REF"];
123+
// When GHES 3.8 support is removed, this if guard and its corresponding
124+
// fallback code can be removed.
125+
if(workflow_ref!==undefined){
126+
constworkflowRegExp=newRegExp("^[^/]+/[^/]+/(.*?)@.*");
127+
constmatch=workflow_ref.match(workflowRegExp);
128+
if(match){
129+
returnnewPromise((resolve)=>{
130+
resolve(match[1]);
131+
});
132+
}
133+
}
122134
constrepo_nwo=getRequiredEnvParam("GITHUB_REPOSITORY").split("/");
123135
constowner=repo_nwo[0];
124136
constrepo=repo_nwo[1];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp