Comments (7)
I encountered the same issue. The problem is triggered under two conditions:
- The target repo is an empty repo, with no commits.
- The selected target branch is an existing branch within the repo (such as the default 'main' branch), but no commits have been made on this branch.
It seems that when there are no commits in the selected branch, this action tries to create it, but this branch actually already exists.
I suspect that the issue may be triggered if a target branch does not have any commits (not just in wholly new repositories), but haven't tested yet.
BTW:
- my solution: commit some random things in the target repo in target branch to make it not empty
- the error message is misleading: the error occurs when trying to remove the worktree in the end, and the real failure is in the "info" of the output.
the error message:
/usr/bin/git worktree remove github-pages-deploy-action-temp-deployment-folder --force
Error: The deploy step encountered an error: There was an error creating the worktree: The process '/usr/bin/git' failed with exit code 128 β β
from github-pages-deploy-action.
Does it work if you turn single-commit to false? This may be access token scope related as cross-deploying to repos with single-commit should work. Can you try increasing the permissions and see if that works?
from github-pages-deploy-action.
Does it work if you turn single-commit to false?
Nope, same error.
It does work if I set the branch to anything else but main, e.g.,
branch: main2
from github-pages-deploy-action.
Couple of questions:
- Is
main
protected? - What scopes have you given your PAT?
- Is the account that the PAT was generated from admin of the org or have admin privileges in the repo?
from github-pages-deploy-action.
Is main protected?
When creating a repo via the API as in the original post, there is no code, and no branch main
in the repo. It's an empty repo.
What scopes have you given your PAT?
Full access to private repos.
Is the account that the PAT was generated from admin of the org or have admin privileges in the repo?
Yes.
(I don't think permissions are a problem since I can create repos with the key, and it all works if I use main2
as a branch name.)
The error message suggests that github-pages-deploy-actions calls
/usr/bin/git checkout --orphan main
in a repo where a main
branch already exists. Not sure at all why it does that. Perhaps the current working directory needs to be changed at some point before that?
from github-pages-deploy-action.
I got the same issue when deploying with "single-commit=true" + "clean:false" to the root "/" of an orphan branch (gh-pages).
This works:
- name: Commit versions.json
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: versions_folder # The folder the action should deploy.
target-folder: / # The folder the action should deploy to.
commit-message: publish documentation
clean: false # do not remove other files (including whole doc versions)
This does not work:
- name: Commit versions.json
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: versions_folder # The folder the action should deploy.
target-folder: / # The folder the action should deploy to.
commit-message: publish documentation
clean: false # do not remove other files (including whole doc versions)
single-commit: true
This worked also:
- with single-commit:true without clean, and to a subfolder:
- name: Deploy documentation in a version subfolder on GH pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs/build/html # The folder the action should deploy.
target-folder: /main # The folder the action should deploy to.
commit-message: publish documentation
single-commit: true
- with single-commit:true, to the root, with a clean-exclude pattern
- name: Deploy documentation in root folder on GH pages π
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs/.vuepress/dist # The folder the action should deploy.
target-folder: / # The folder the action should deploy to.
commit-message: publish documentation
single-commit: true
clean-exclude: |
"version/*"
from github-pages-deploy-action.
I found why i add examples working and others not working. Actually in the example not working (single-commit:true) i was also doing a checkout of gh-pages (the very branch on which i want to deploy) before in order to parse something. So this is the sequence making the bug:
- checkout gh-pages
- do some stuff
- try to publish on gh-pages (same branch) with "single-commit:true" (without single-commit, it is actually working)
update-doc-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: gh-pages
- name: Do some stuff to generate something in versions_folder
run: ...
- name: Commit versions.json
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: versions_folder # The folder the action should deploy.
target-folder: / # The folder the action should deploy to.
commit-message: publish documentation
clean: false # do not remove other files (including whole doc versions)
single-commit: true
from github-pages-deploy-action.
Related Issues (20)
- Commit fails with "process '/usr/bin/git' failed with exit code 128" HOT 3
- Error: You must provide the action with a folder to deploy.
- This project is now deprecated
- GitHub Actions `set-output` command is deprecated and will be disabled soon HOT 2
- Reporting a vulnerability HOT 1
- `token` not being used sometimes HOT 2
- Pushed file asyncapi.html gets renamed to index.html HOT 3
- Can't push folder in project HOT 2
- remote: Permission denied to github-actions[bot] HOT 1
- I have this problem, everyone can help me ? This is for a react project HOT 1
- Git config not found for centos:7 HOT 2
- Action succeeds even when push fails HOT 1
- GitHub Pages re-building with Jekyll despite .nojekyll present HOT 1
- A file is missing or not transferred to github pages HOT 5
- The directory you're trying to deploy named /home/runner/work/RivioxTweaks/RivioxTweaks/dist doesn't exist. HOT 1
- There is nothing to commit. Exiting early⦠HOT 1
- The deploy step encountered an error: The process '/usr/bin/git' failed with exit code 1 β HOT 3
- fatal: Authentication failed HOT 1
- Error: The deploy step encountered an error: The process '/usr/bin/git' failed with exit code 128 β HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from github-pages-deploy-action.