-
Notifications
You must be signed in to change notification settings - Fork 35
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add option to skip-verification #411
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2803,6 +2803,7 @@ module.exports = async function run({ | |
TARGET, | ||
PR_NUMBER, | ||
SKIP_COMMIT_VERIFICATION, | ||
SKIP_VERIFICATION, | ||
} = getInputs(inputs) | ||
|
||
try { | ||
|
@@ -2820,16 +2821,16 @@ module.exports = async function run({ | |
const pr = pull_request || (await client.getPullRequest(PR_NUMBER)) | ||
|
||
const isDependabotPR = pr.user.login === dependabotAuthor | ||
if (!isDependabotPR) { | ||
if (!isDependabotPR && !SKIP_VERIFICATION) { | ||
return logWarning('Not a dependabot PR, skipping.') | ||
} | ||
|
||
const commits = await client.getPullRequestCommits(pr.number) | ||
if (!commits.every(commit => commit.author?.login === dependabotAuthor)) { | ||
if (!commits.every(commit => commit.author?.login === dependabotAuthor) && !SKIP_VERIFICATION) { | ||
return logWarning('PR contains non dependabot commits, skipping.') | ||
} | ||
|
||
if (!SKIP_COMMIT_VERIFICATION) { | ||
if (!SKIP_COMMIT_VERIFICATION && !SKIP_VERIFICATION) { | ||
try { | ||
verifyCommits(commits) | ||
} catch { | ||
|
@@ -3132,6 +3133,7 @@ exports.getInputs = inputs => { | |
TARGET: mapUpdateType(inputs['target']), | ||
PR_NUMBER: inputs['pr-number'], | ||
SKIP_COMMIT_VERIFICATION: /true/i.test(inputs['skip-commit-verification']), | ||
SKIP_VERIFICATION: /true/i.test(inputs['skip-verification']), | ||
} | ||
} | ||
|
||
|
@@ -3280,7 +3282,7 @@ module.exports = require("util"); | |
/***/ ((module) => { | ||
|
||
"use strict"; | ||
module.exports = JSON.parse('{"name":"github-action-merge-dependabot","version":"3.6.4","description":"A GitHub action to automatically merge and approve Dependabot pull requests","main":"src/index.js","scripts":{"build":"ncc build src/index.js","lint":"eslint .","test":"tap test/**.test.js","prepare":"husky install"},"author":{"name":"Salman Mitha","email":"[email protected]"},"contributors":["Simone Busoli <[email protected]>"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/github-action-merge-dependabot.git"},"bugs":{"url":"https://github.com/fastify/github-action-merge-dependabot/issues"},"homepage":"https://github.com/fastify/github-action-merge-dependabot#readme","dependencies":{"@actions/core":"^1.9.1","@actions/github":"^5.1.1","actions-toolkit":"github:nearform/actions-toolkit","gitdiff-parser":"^0.3.1","semver":"^7.4.0"},"devDependencies":{"@vercel/ncc":"^0.36.1","eslint":"^8.38.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","husky":"^8.0.3","prettier":"^2.8.7","proxyquire":"^2.1.3","sinon":"^15.0.3","tap":"^16.3.4"}}'); | ||
module.exports = JSON.parse('{"name":"github-action-merge-dependabot","version":"3.6.4","description":"A GitHub action to automatically merge and approve Dependabot pull requests","main":"src/index.js","scripts":{"build":"ncc build src/index.js","lint":"eslint .","test":"tap test/**.test.js","prepare":"husky install"},"author":{"name":"Salman Mitha","email":"[email protected]"},"contributors":["Simone Busoli <[email protected]>"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/fastify/github-action-merge-dependabot.git"},"bugs":{"url":"https://github.com/fastify/github-action-merge-dependabot/issues"},"homepage":"https://github.com/fastify/github-action-merge-dependabot#readme","dependencies":{"@actions/core":"^1.9.1","@actions/github":"^5.1.1","actions-toolkit":"github:nearform/actions-toolkit","gitdiff-parser":"^0.3.1","semver":"^7.5.0"},"devDependencies":{"@vercel/ncc":"^0.36.1","eslint":"^8.39.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","husky":"^8.0.3","prettier":"^2.8.8","proxyquire":"^2.1.3","sinon":"^15.0.4","tap":"^16.3.4"}}'); | ||
|
||
/***/ }) | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This diff looks a bit large because the table had to be centered to keep the alignment.
To aid in review, you can disable white-spaces from the diff OR you can render it here : https://github.com/yeikel/github-action-merge-dependabot/blob/feat/skip-verification/README.md
The only change besides alignment is to add the newly introduced
skip-verification
field