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

Bug: fails if the gh-pages branch doesn't exist #91

Closed
noc7c9 opened this issue Feb 6, 2020 · 4 comments · Fixed by #92
Closed

Bug: fails if the gh-pages branch doesn't exist #91

noc7c9 opened this issue Feb 6, 2020 · 4 comments · Fixed by #92
Assignees
Labels
bug Something isn't working resolved

Comments

@noc7c9
Copy link

noc7c9 commented Feb 6, 2020

Describe the bug
I've attempted to use this action in a new repository where the branch doesn't exist.

I found this issue but it recommends using ACTIONS_DEPLOY_KEY which I am and setting emptyCommits: true which isn't the behaviour I want.

I managed to solve this by creating the gh-pages branch and rerunning the workflow but I feel like this action would be much friendlier but not having this issue in the first place.

To Reproduce

  1. Create a new repository with an index.html file on the master branch
  2. Setup workflow config as above
  3. Trigger workflow
  4. Workflow fails with
/usr/bin/git clone --depth=1 --single-branch --branch gh-pages [email protected]:noc7c9/i-love-hue-rs-clone.git /home/runner/actions_github_pages
Cloning into '/home/runner/actions_github_pages'...
Warning: Permanently added the RSA host key for IP address '192.30.253.113' to the list of known hosts.
warning: Could not find remote branch gh-pages to clone.
fatal: Remote branch gh-pages not found in upstream origin
##[error]Action failed with "Error: Error: The process '/usr/bin/git' failed with exit code 128"
##[error]Node run failed with exit code 1

Expected behavior
I expected the action to create the branch since it doesn't exist.

Your YAML file
https://github.com/noc7c9/i-love-hue-rs-clone/blob/master/.github/workflows/gh-pages.yml

Relevant part of the file:

            - name: Deploy
              uses: peaceiris/actions-gh-pages@v3
              with:
                  deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
                  publish_dir: ./target/deploy
@peaceiris
Copy link
Owner

peaceiris commented Feb 6, 2020

@noc7c9
Thank you for reporting.

This problem was fixed by #92

The v3.0.3 has been released and the v3 tag updated.

Delete gh-pages branch and try to use v3! The gh-pages branch will be created.

- name: Deploy
  uses: peaceiris/actions-gh-pages@v3
  with:
    deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
    publish_dir: ./target/deploy

@peaceiris peaceiris pinned this issue Feb 6, 2020
@peaceiris
Copy link
Owner

And all options were renamed on v3. Check actions-gh-pages/action.yml at v3

@noc7c9
Copy link
Author

noc7c9 commented Feb 6, 2020

Hey thanks for the quick fix (and the project too!). It's working perfectly now.

@noc7c9 noc7c9 closed this as completed Feb 6, 2020
@peaceiris peaceiris unpinned this issue Feb 6, 2020
@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

Successfully merging a pull request may close this issue.

2 participants