Skip to content

Commit

Permalink
#539 adding random merge status keys
Browse files Browse the repository at this point in the history
  • Loading branch information
PhanindraNeralla committed Feb 7, 2024
1 parent f5dae52 commit b45f3d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2902,9 +2902,7 @@ module.exports = async function run({
try {
toolkit.logActionRefWarning()

const { pull_request } = context.payload
core.setOutput(MERGE_STATUS_KEY, "Random_output_merge_key")
core.setOutput("Random_Key", "Random_output")
const { pull_request } = context.payload
if (!pull_request && !PR_NUMBER) {
core.setOutput(MERGE_STATUS_KEY, MERGE_STATUS.skippedNotADependabotPr)
return logError(
Expand All @@ -2916,9 +2914,12 @@ module.exports = async function run({
const pr = pull_request || (await client.getPullRequest(PR_NUMBER))

const isDependabotPR = pr.user.login === dependabotAuthor
if (!SKIP_VERIFICATION && !isDependabotPR) {
core.setOutput(MERGE_STATUS_KEY, "Random_output_merge_key")
core.setOutput("Random_Key", "Random_output")
if (!SKIP_VERIFICATION && !isDependabotPR) {
core.setOutput("Random_Key_test", "Random_output_2")
core.setOutput(MERGE_STATUS_KEY, MERGE_STATUS.skippedNotADependabotPr)
return logWarning('Not a dependabot PR, skipping.')
return logWarning('Not a dependabot PR, skipping test.')
}

const commits = await client.getPullRequestCommits(pr.number)
Expand Down
11 changes: 6 additions & 5 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ module.exports = async function run({
try {
toolkit.logActionRefWarning()

const { pull_request } = context.payload
core.setOutput(MERGE_STATUS_KEY, "Random_output_merge_key")
core.setOutput("Random_Key", "Random_output")
const { pull_request } = context.payload

Check failure on line 46 in src/action.js

View workflow job for this annotation

GitHub Actions / build

Delete `····`
if (!pull_request && !PR_NUMBER) {
core.setOutput(MERGE_STATUS_KEY, MERGE_STATUS.skippedNotADependabotPr)
return logError(
Expand All @@ -57,9 +55,12 @@ module.exports = async function run({
const pr = pull_request || (await client.getPullRequest(PR_NUMBER))

const isDependabotPR = pr.user.login === dependabotAuthor
if (!SKIP_VERIFICATION && !isDependabotPR) {
core.setOutput(MERGE_STATUS_KEY, "Random_output_merge_key")

Check failure on line 58 in src/action.js

View workflow job for this annotation

GitHub Actions / build

Replace `"Random_output_merge_key"` with `'Random_output_merge_key'`
core.setOutput("Random_Key", "Random_output")

Check failure on line 59 in src/action.js

View workflow job for this annotation

GitHub Actions / build

Replace `"Random_Key",·"Random_output"` with `'Random_Key',·'Random_output'`
if (!SKIP_VERIFICATION && !isDependabotPR) {

Check failure on line 60 in src/action.js

View workflow job for this annotation

GitHub Actions / build

Delete `······`
core.setOutput("Random_Key_test", "Random_output_2")

Check failure on line 61 in src/action.js

View workflow job for this annotation

GitHub Actions / build

Replace `"Random_Key_test",·"Random_output_2"` with `'Random_Key_test',·'Random_output_2'`
core.setOutput(MERGE_STATUS_KEY, MERGE_STATUS.skippedNotADependabotPr)
return logWarning('Not a dependabot PR, skipping.')
return logWarning('Not a dependabot PR, skipping test.')
}

const commits = await client.getPullRequestCommits(pr.number)
Expand Down

0 comments on commit b45f3d0

Please sign in to comment.