X Tutup
The Wayback Machine - https://web.archive.org/web/20200917114455/https://github.com/github/platform-samples/pull/222
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

Add first version of "block skip checks" hook #222

Open
wants to merge 1 commit into
base: master
from

Conversation

@steffen
Copy link
Contributor

steffen commented Dec 11, 2018

This hook disallows skipping status checks.

It's basically disabling this feature:
https://help.github.com/articles/about-status-checks/#skipping-and-requesting-checks-for-individual-commits

ERROR_MSG="[POLICY] Skipping checks is not allowed. Please remove trailer lines with \"skip-checks: true\"."

while read OLDREV NEWREV REFNAME ; do
for COMMIT in `git rev-list $OLDREV..$NEWREV`;

This comment has been minimized.

@larsxschneider

larsxschneider Dec 11, 2018 Member

I think this call would fail if you push a new branch as $OLDREV is 40 zeros in that case. See https://github.com/github/platform-samples/blob/master/pre-receive-hooks/block_confidentials.sh#L38

This comment has been minimized.

@jonico

jonico Dec 12, 2018 Contributor

I would also wonder whether you like to recheck all commits again if somebody was copying a branch and pushing it again with a new commit on top, have a look at https://github.com/github/platform-samples/blob/master/pre-receive-hooks/block_unsigned_commits.sh#L15-L42 for an example how to exclude commits already in the repo

Copy link
Member

stoe left a comment

This looks promising.
Only thing it doesn’t handle is pushes that create a new branch, zero sha.

@steffen steffen self-assigned this Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.
X Tutup