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

Skipping branch status checks #4

Open
jdbence opened this issue Sep 10, 2020 · 14 comments
Open

Skipping branch status checks #4

jdbence opened this issue Sep 10, 2020 · 14 comments
Assignees
Labels
enhancement New feature or request

Comments

@jdbence
Copy link

jdbence commented Sep 10, 2020

Hello! I would like to enable Github branch protection rules on my master branch. Is it possible to update this action to skip status checks when making a commit to increase the package version?

I'm guessing it has to be added here

bump/index.js

Line 48 in 876e407

await exec('npm', ['version', strategy, '--no-commit-hooks', '-m', `${commitMessage} %s`]);

Github's example
https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/about-status-checks#skipping-and-requesting-checks-for-individual-commits

$ git commit -m "Update README.
>
>
skip-checks: true
@tool3
Copy link
Owner

tool3 commented Sep 10, 2020

hey @jdbence !

absolutely.. can you run a test against branch feat/skip_checks?

so just run a workflow using:

- uses: tool3/bump@feat/skip_checks

@tool3 tool3 added the enhancement New feature or request label Sep 10, 2020
@tool3 tool3 self-assigned this Sep 10, 2020
@jdbence
Copy link
Author

jdbence commented Sep 10, 2020

It doesn't seem to work. It might be from the %s at the end of the literal or that you need another \n to actually have two spaces between the skip-checks: true

bump/index.js

Line 53 in 3febd9f

await exec('npm', ['version', strategy, '--no-commit-hooks', '-m', `${commitMessage} %s`]);

@tool3
Copy link
Owner

tool3 commented Sep 10, 2020

yeah just noticed that... I fixed it for now by putting the version string at the beginning of the commit msg

so please try again :)

@jdbence
Copy link
Author

jdbence commented Sep 10, 2020

I get this same error. Did you see my edited message above about adding another \n?

remote: error: GH006: Protected branch update failed for refs/heads/master.        
remote: error: Required status check "Test" is expected. 

@tool3
Copy link
Owner

tool3 commented Sep 10, 2020

oh no I did't sorry about that...just added another \n

@jdbence
Copy link
Author

jdbence commented Sep 10, 2020

That seems to have the same result. Maybe its from not having a starting quote for the message?

After your commit description, instead of a closing quotation, add two empty lines followed by skip-checks: true:

@tool3
Copy link
Owner

tool3 commented Sep 10, 2020

Yeah I was just able to push a real commit with this format so let me try another thing

@tool3
Copy link
Owner

tool3 commented Sep 10, 2020

this is quite a unique requirement since I am running all of this through npm version

so I just added > after each line break to see if git parses that correctly

this is probably not going to work too... so let me think of a creative solution

of course you are more than welcome to have a go yourself

@jdbence
Copy link
Author

jdbence commented Sep 10, 2020

bump/index.js

Line 34 in 144b99f

commitMessage = `${commitMessage}\n>\n>\nskip-checks: true`

What if you create them with actual spaces?

commitMessage = '`${commitMessage}


skip-checks: true'

@tool3
Copy link
Owner

tool3 commented Sep 10, 2020

yup.. just did buddy

@tool3
Copy link
Owner

tool3 commented Sep 10, 2020

@jdbence any luck? sorry had very little time to work on this today

@jdbence
Copy link
Author

jdbence commented Sep 10, 2020

I tried and bunch of different things. I contacted Github support to see if they have an idea. I'll let you know if/what they say.

@jdbence
Copy link
Author

jdbence commented Oct 22, 2020

I got a reply from a Github Rep.
They said adding the '[skip ci]' to the message should be enough but you cant read the message directly anymore.
They suggested using another Github Action in combination with this one that checks for the 'skip-checks' we set
https://github.com/marketplace?type=actions&query=commit+message

So I'll see if I can get something like that working.

@tool3
Copy link
Owner

tool3 commented Oct 22, 2020

@jdbence thanks! Please update if you find anything.
A PR is more than welcome 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants