| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -291,7 +291,8 @@ export function buildPayload( | |
| checkoutURI: string, | ||
| environment: string | undefined, | ||
| toolNames: string[], | ||
| gitHubVersion: util.GitHubVersion | ||
| gitHubVersion: util.GitHubVersion, | ||
| mergeBaseCommitOid: string | undefined | ||
| ) { | ||
| if (util.isActions()) { | ||
| const payloadObj = { | ||
| Expand All | @@ -314,15 +315,28 @@ export function buildPayload( | |
| gitHubVersion.type !== util.GitHubVariant.GHES || | ||
| semver.satisfies(gitHubVersion.version, `>=3.1`) | ||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityDo we need to change the satisfies here? Will GHES < 3.4 accept the new mergeBaseCommitOid parameter?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThere is no new parameter on the dotcom side. This is only about computing a better value for the existing parameter base_sha in some cases. mergeBaseCommitOid is passed into the buildPayload function in this library which then selects it as the base_sha or not.
Sorry, something went wrong.
All reactions
|
||
| ) { | ||
| if ( | ||
| process.env.GITHUB_EVENT_NAME === "pull_request" && | ||
| process.env.GITHUB_EVENT_PATH | ||
| ) { | ||
| const githubEvent = JSON.parse( | ||
| fs.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") | ||
| ); | ||
| payloadObj.base_ref = `refs/heads/${githubEvent.pull_request.base.ref}`; | ||
| payloadObj.base_sha = githubEvent.pull_request.base.sha; | ||
| if (process.env.GITHUB_EVENT_NAME === "pull_request") { | ||
| if ( | ||
| commitOid === util.getRequiredEnvParam("GITHUB_SHA") && | ||
| mergeBaseCommitOid | ||
| ) { | ||
| // We're uploading results for the merge commit | ||
| // and were able to determine the merge base. | ||
| // So we use that as the most accurate base. | ||
| payloadObj.base_ref = `refs/heads/${util.getRequiredEnvParam( | ||
| "GITHUB_BASE_REF" | ||
| )}`; | ||
| payloadObj.base_sha = mergeBaseCommitOid; | ||
| } else if (process.env.GITHUB_EVENT_PATH) { | ||
| // Either we're not uploading results for the merge commit | ||
| // or we could not determine the merge base. | ||
| // Using the PR base is the only option here | ||
| const githubEvent = JSON.parse( | ||
| fs.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") | ||
| ); | ||
| payloadObj.base_ref = `refs/heads/${githubEvent.pull_request.base.ref}`; | ||
| payloadObj.base_sha = githubEvent.pull_request.base.sha; | ||
| } | ||
| } | ||
| } | ||
| return payloadObj; | ||
| Expand Down Expand Up | @@ -389,7 +403,8 @@ async function uploadFiles( | |
| checkoutURI, | ||
| environment, | ||
| toolNames, | ||
| gitHubVersion | ||
| gitHubVersion, | ||
| await actionsUtil.determineMergeBaseCommitOid() | ||
| ); | ||
|
|
||
| // Log some useful debug info about the info | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityNice trick to get the merge base.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.