add-and-commit: Getting Error: There is no tracking information for the current branch.
Hi, I’m generating some files and want to use GHA to commit the files here’s my step in config
- name: NPM Generate Sass Docs
run: |
npm run generate:sass:docs
- name: Commit sass docs
uses: EndBug/add-and-commit@v7
with:
add: 'public/sassDocs'
author_name: Github Action
author_email: gha@meredith.com
message: 'Generated sass docs'
But sometimes I get the following error:
Add input parsed as single string, running 1 git add command.
> Using 'Github Action <gha@meredith.com>' as author.
> Using "Generated sass docs" as commit message.
> Running for a PR, the action will use 'feature/PLAT-263-generate-sass-doc' as ref.
Internal logs
Outputs
committed: false
pushed: false
tagged: false
Error: Error: There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> feature/PLAT-263-generate-sass-doc
Could anyone help and let me know what I should do?
Thanks
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 17 (4 by maintainers)
I see this when it is triggered by an
on: pull_requestevent on a fork PR. Triggering it withon: push, so that it runs in the fork context, fixes it for me.