add-and-commit
add-and-commit copied to clipboard
pushing a commit to the branch that the github action is ran on
- uses: EndBug/[email protected]
with:
add: 'something/frontend/src/locales/en/en.json'
message: '[skip ci] Update translations from scanner'
push: --force
This works but we want to run on the latest version
so we migrated to
- uses: EndBug/[email protected]
with:
add: 'something/frontend/src/locales/en/en.json'
message: '[skip ci] Update translations from scanner'
push: --force
This is not working, the error is Error: fatal: You are not currently on a branch.
Thank you for any help or assistance in advance
Since v8.0.0, the action works with whatever has been checked out in previous steps (changelog).
If you check out the branch you want to push to with either git commands or actions/checkout, then the action will push to that branch.
You can also use the pull input to run git pull before creating the commit.
@callum-maguire I got it working with the following
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
....
- name: Update pull request
uses: EndBug/add-and-commit@v9
with:
author_name: i18n Extract
committer_name: GitHub Actions
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
add: '*.xlf'
fetch: false
Hope this helps you too.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.