You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to create a workflow that will update PRs on change. I don't want to create a new commit and would prefer to amend the automatic change to head commit in PR.
What I found is that for some reason the whole history is replaced with single new commit.
Steps to reproduce
It should be enough to run the example workflow.
Tried solutions
It is fine if I remove the amend command but it is not desired solution.
Example Workflow
my config name: Release plz on:
pull_request:
jobs:
print_commit_name:
runs-on: ubuntu-latestpermissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.contents: writeif: startsWith(github.head_ref, 'release_')steps:
- uses: actions/checkout@v3with:
ref: ${{ github.head_ref }}
- name: Create new file run: echo '\n// New commit' > src/main.rs
- uses: stefanzweifel/git-auto-commit-action@v4with:
commit_options: '--amend'push_options: '--force'
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
Using --amend can be dangerous. I thought I had a section about this in the README, but there's only this section about using it in combination with --no-edit.
The problem lies in how actions/checkout checks out a repository. By default, only the last commit (1 commit) is checked out / fetched and not the entire repo history.
Another user ran into a similar issue in #159 (comment).
To solve this, add fetch-depth: 2 and skip_fetch: true to your job.
git-auto-commit Version
v4
Machine Type
Ubuntu (eg. ubuntu-latest)
Bug description
I try to create a workflow that will update PRs on change. I don't want to create a new commit and would prefer to
amend
the automatic change to head commit in PR.What I found is that for some reason the whole history is replaced with single new commit.
Steps to reproduce
It should be enough to run the
example workflow
.Tried solutions
It is fine if I remove the
amend
command but it is not desired solution.Example Workflow
Relevant log output
No response
The text was updated successfully, but these errors were encountered: