Repository navigation
Closed
Description
Subject of the issue
Update from v6 to v7 broke branches autosync: Keep a branch up-to-date with another
Logs:
/usr/bin/git branch --delete --force 01e9c082-9f8a-484e-ae64-71f88826f179
Deleted branch 01e9c082-9f8a-484e-ae64-71f88826f179 (was bc810dcf65).
/usr/bin/git checkout --progress develop --
Switched to branch 'develop'
Your branch is up to date with 'origin/develop'.
Pushing pull request branch to 'origin/sync/release/10.17.0-into-develop'
/usr/bin/git stash push --include-untracked
No local changes to save
/usr/bin/git checkout --progress sync/release/10.17.0-into-develop --
Switched to branch 'sync/release/10.17.0-into-develop'
Creating tree objects for local commit 148e4896bf968684c12e6ded7e35fb6c3c6fe478
Error: Cannot destructure property 'path' of 'undefined' as it is undefined.
Only changes I've made to step is:
- Updated to
v7 - Renamed
tokenintobranch-token - Enabled
sign-commits
Steps to reproduce
Job with v6
This works just fine:
name: Release → Develop
on:
push:
branches:
- 'release/**'
workflow_dispatch:
jobs:
merge-release-to-develop:
runs-on: ubuntu-latest
timeout-minutes: 3
env:
BRANCH_NAME: 'sync/${{ github.ref_name }}-into-develop'
steps:
- uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
- uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Reset promotion branch
run: |
git fetch origin ${{ github.ref_name }}:${{ github.ref_name }}
git reset --hard ${{ github.ref_name }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate-token.outputs.token }}
base: 'develop'
branch: '${{ env.BRANCH_NAME }}'
title: '${{ github.ref_name }} → develop'
- name: Enable automerge
if: ${{ steps.cpr.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: gh pr merge --merge --auto ${{ steps.cpr.outputs.pull-request-number }}
Job with v7
This doesn't work:
name: Release → Develop
on:
push:
branches:
- 'release/**'
workflow_dispatch:
jobs:
merge-release-to-develop:
runs-on: ubuntu-latest
timeout-minutes: 3
env:
BRANCH_NAME: 'sync/${{ github.ref_name }}-into-develop'
steps:
- uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
- uses: tibdex/github-app-token@v2
id: generate-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Reset promotion branch
run: |
git fetch origin ${{ github.ref_name }}:${{ github.ref_name }}
git reset --hard ${{ github.ref_name }}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v7
with:
branch-token: ${{ steps.generate-token.outputs.token }}
sign-commits: true
base: 'develop'
branch: '${{ env.BRANCH_NAME }}'
title: '${{ github.ref_name }} → develop'
- name: Enable automerge
if: ${{ steps.cpr.outputs.pull-request-number }}
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: gh pr merge --merge --auto ${{ steps.cpr.outputs.pull-request-number }}
Metadata
Metadata
Assignees
Labels
No labels
Activity
peter-evans commentedon Sep 12, 2024
Hi @AllDmeat
Thanks for reporting. I'm fairly sure this will work as it did before if you disable
sign-commits. I'll investigate this and see why the commit signing code path fails in this case.peter-evans commentedon Sep 12, 2024
Are you able to provide the full log of the run? That would be very useful if you can.
Or, if there are log lines which say
Skipping unexpected diff entryyou can just provide those. I have a suspicion it could be related to that.peter-evans commentedon Sep 12, 2024
I've released a change in
v7.0.2/v7, which may fix it for you. Please try it and let me know.If it doesn't fix the issue, please look for warning lines in the log which start with
Skipping unexpected diff entry, and let me know the detail of the lines.fix: try to fix gen-changelog
AnnAngela commentedon Sep 15, 2024
Hi, we had this very same issue, and this is the gha run entry: https://github.com/MaaAssistantArknights/MaaAssistantArknights/actions/runs/10869083828
There was a report about skipping unexpected diff entry:
Skipping unexpected diff entry: :100644 100644 cb971edb7 5a6d3aa95 M CHANGELOG.mdI believed that the run used
v7.0.2since it downloaded commitd121e62763d8cc35b5fb1710e887d6e69a52d3a4which is the commit d121e62 marked as https://github.com/peter-evans/create-pull-request/releases/tag/v7.0.2luong-komorebi commentedon Sep 16, 2024
I am experiencing the same problem. Let me know which kind of information can be helpful for the debugging process of this
I did see warnings on almost all the changes that we had
peter-evans commentedon Sep 16, 2024
@AnnAngela @luong-komorebi Thank you both for your reports. I've identified the issue and I have a fix ready to release.
peter-evans commentedon Sep 16, 2024
@AnnAngela @luong-komorebi I've released
v7.0.3/v7to fix the issue you both reported. Thank you! ✨I'm still going to leave this issue open. The nature of this particular feature means that there could be other related issues that also cause the same error.
For anyone experiencing this error on
v7.0.3please look for warning lines in the log which start withSkipping unexpected diff entry, and let me know the detail of the lines.ci: 重新尝试让机器人对 commit 签名
luong-komorebi commentedon Sep 16, 2024
I can confirm that this issue is now resolved. @peter-evans Thank you for your prompt support
AllDmeat commentedon Sep 17, 2024
Sorry, missed your message. There were such logs.
Updating to 7.0.3 fixed issue for me. Thanks a lot.
AnnAngela commentedon Sep 22, 2024
Updating to 7.0.3 fixed issue for us, like MaaAssistantArknights/MaaAssistantArknights@
a69a45e(#10657). Thanks so much.