Skip to content
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: new input skip_dependabot with default true #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions dco-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
description: 'Whether to allow commits missing "Signed-off by:" but containing "Co-authored-by:"'
required: false
default: false
skip_dependabot:
description: 'Skip commits authored by dependabot[bot]'
required: false
default: true
runs:
using: 'composite'
steps:
Expand All @@ -33,10 +37,17 @@ runs:
allow_reverts: ${{ inputs.allow_reverts }}
allow_no_signoff: ${{ inputs.allow_no-signoff }}
allow_co_authored: ${{ inputs.allow_co-authored }}
skip_dependabot: ${{ inputs.skip_dependabot }}
run: |
set -eu
status=0
for commit in $(git rev-list "origin/${base_ref#refs/heads/}..${head_ref#refs/heads/}"); do
if [[ "true" == "${skip_dependabot,,}" ]] &&
[[ "dependabot[bot]" == "$(git show -s --format=%an "$commit")" ]]
then
continue
fi

if [[ "true" != "${allow_merges,,}" ]] &&
git show -s --format=%P "$commit" | grep -qF " "
then
Expand Down