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

Prohibited branch detection does not work #245

Closed
peaceiris opened this issue Apr 23, 2020 · 6 comments
Closed

Prohibited branch detection does not work #245

peaceiris opened this issue Apr 23, 2020 · 6 comments
Assignees
Labels
bug Something isn't working resolved

Comments

@peaceiris
Copy link
Owner

peaceiris commented Apr 23, 2020

Describe the bug

When users set a publish_branch that is the same as a branch triggered by the workflow, this action stops the deployment to protect the branch.

if (eventName === 'push') {
isProhibitedBranch = ref.includes(`refs/heads/${publishBranch}`);
if (isProhibitedBranch) {
throw new Error(`You deploy from ${publishBranch} to ${publishBranch}`);
}
}

Currently, this protection behavior does not work.

To Reproduce

With peaceiris/actions-gh-pages@v3

on:
  push:
    branches:
      - master
...
          publish_branch: master

Expected behavior
This Action should return the error You deploy from master to master

Screenshots
Screen Shot 2020-04-23 at 13 06 22

Your YAML file

Additional context
I found this bug in this article: AsciidocのドキュメントをGitHub Actionsを用いてGitHub Pagesで公開する。 - Qiita

This protection should be also implemented for personal_token, deploy_key, and eventName === 'pull_request'.

@peaceiris peaceiris added the bug Something isn't working label Apr 23, 2020
@peaceiris peaceiris self-assigned this Apr 23, 2020
@abedurftig

This comment has been minimized.

@peaceiris

This comment has been minimized.

@peaceiris

This comment has been minimized.

@abedurftig
Copy link

@peaceiris, thanks for following up. I see my mistake. I think the README is clear now.

@peaceiris
Copy link
Owner Author

It works well now.

@github-actions
Copy link
Contributor

This issue has been LOCKED because of it being resolved!

The issue has been fixed and is therefore considered resolved.
If you still encounter this or it has changed, open a new issue instead of responding to solved ones.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working resolved
Projects
None yet
Development

No branches or pull requests

2 participants