WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129508,7 +129508,7 @@ async function Scan(gitleaksEnableUploadArtifact, scanInfo, eventType) {
"--log-level=debug",
];

if (eventType == "push") {
if (eventType == "push" || eventType == "merge_group") {
if (scanInfo.baseRef == scanInfo.headRef) {
// if base and head refs are the same, use `--log-opts=-1` to
// scan only one commit
Expand Down Expand Up @@ -140621,6 +140621,7 @@ let eventJSON = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH, "utf8"));
// Examples of event types: "workflow_dispatch", "push", "pull_request", etc
const eventType = process.env.GITHUB_EVENT_NAME;
const supportedEvents = [
"merge_group",
"push",
"pull_request",
"workflow_dispatch",
Expand Down Expand Up @@ -140708,7 +140709,7 @@ octokit
async function start() {
// validate key first

// keygen payment method is getting declined... disable this check for now.
// keygen payment method is getting declined... disable this check for now.
// if (shouldValidate) {
// core.debug(
// `eventJSON.repository.full_name: ${eventJSON.repository.full_name}`
Expand Down Expand Up @@ -140773,6 +140774,18 @@ async function start() {
eventJSON,
eventType
);
} else if (eventType === "merge_group") {
scanInfo = {
gitleaksPath: gitleaksPath,
baseRef: eventJSON.merge_group.base_sha,
headRef: eventJSON.merge_group.head_sha,
};

exitCode = await gitleaks.Scan(
gitleaksEnableUploadArtifact,
scanInfo,
eventType
);
}

// after gitleaks scan, update the job summary
Expand Down
2 changes: 1 addition & 1 deletion src/gitleaks.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async function Scan(gitleaksEnableUploadArtifact, scanInfo, eventType) {
"--log-level=debug",
];

if (eventType == "push") {
if (eventType == "push" || eventType == "merge_group") {
if (scanInfo.baseRef == scanInfo.headRef) {
// if base and head refs are the same, use `--log-opts=-1` to
// scan only one commit
Expand Down
15 changes: 14 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ let eventJSON = JSON.parse(readFileSync(process.env.GITHUB_EVENT_PATH, "utf8"));
// Examples of event types: "workflow_dispatch", "push", "pull_request", etc
const eventType = process.env.GITHUB_EVENT_NAME;
const supportedEvents = [
"merge_group",
"push",
"pull_request",
"workflow_dispatch",
Expand Down Expand Up @@ -121,7 +122,7 @@ octokit
async function start() {
// validate key first

// keygen payment method is getting declined... disable this check for now.
// keygen payment method is getting declined... disable this check for now.
// if (shouldValidate) {
// core.debug(
// `eventJSON.repository.full_name: ${eventJSON.repository.full_name}`
Expand Down Expand Up @@ -186,6 +187,18 @@ async function start() {
eventJSON,
eventType
);
} else if (eventType === "merge_group") {
scanInfo = {
gitleaksPath: gitleaksPath,
baseRef: eventJSON.merge_group.base_sha,
headRef: eventJSON.merge_group.head_sha,
};

exitCode = await gitleaks.Scan(
gitleaksEnableUploadArtifact,
scanInfo,
eventType
);
}

// after gitleaks scan, update the job summary
Expand Down