-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Support for publish_branch that is the same as the triggering branch? #358
Comments
When you set a branch name as the same as the triggering branch, it will overwrite all files with the files under the I read your YAML but I do not understand what you want to do. Do you know the GitHub Pages spec and basic usage? Could you tell me what is your deployment assets? |
Let's imagine a project powered by Static Site Generators. We are managing source files (Markdown and template files) and generating output files like HTML, CSS, and JavaScript files. In this case, when we set a branch name as the same as the triggering branch, it will overwrite all Markdown files with the HTML files under the publish_dir. We cannot run the next CI on the branch. |
Prior to deployment, CI rebuilds READMEs that change when data ends up changing. We want the READMEs on a branch to automatically update when the data on that branch change. Copying the relevant section of our workflow: - name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
# external_repository: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .
publish_branch: ${{ env.BRANCH }}
# without keep_files, .github/workflows/pythonapp.yml was removed
keep_files: true
That is the goal. When CI changes a file, we want that change to be pushed back to the triggering branch.
We don't want CI to run on the CI-generated commit, although it's not terrible if it does, since there shouldn't be any new changes and deployment would therefore be skipped. Setting
In our case, we set |
This action does not support this use case. I just recommend you to use git commands. - name: update
run: |
git add .
git commit -m "update"
git push origin YOUR_BRANCH |
Okay good to know. I imagine we'd also have to configure git to use Regarding the initial error message of
Thanks for the quick responses! |
The - name: update
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
echo "hoge" >> README.md
git commit -am "add hoge"
git push origin master |
Thank you for the feedback! I will work on it at #359 |
Hey @peaceiris, any chance you could make this constraint (no same branch deploy) non-blocking when the deploy is for an external repository? This is a case where a same branch deploy would make sense. I can open a new issue if you wish so. Thanks! |
@fabiendem
|
If you have another question, ask here or open another issue. |
Hey thank you, |
Currently, we're getting the following error for this CI config:
From #245, it sounds like this is the intended behavior to:
In our case, we use CI to regenerate some files. The use case is similar to linting. Imagine CI is used to lint files that should be committed back to the same branch.
What are the reasons that publishing to the triggering branch is forbidden? Is there a workaround?
The text was updated successfully, but these errors were encountered: