Open zhaohuanyuu opened 9 months ago
+1 - We're also experiencing the same issue with this action.
+1 experiencing the same issue while publishing using changeset with github actions
+1 Here. I'm not really sure if there is some setting. but it happens with GitHub actions
Run changesets/action@v1
setting git user
/usr/bin/git config user.name "github-actions[bot]"
/usr/bin/git config user.email "github-actions[bot]@users.noreply.github.com"
setting GitHub credentials
/usr/bin/git checkout changeset-release/refs/pull/22/merge
error: pathspec 'changeset-release/refs/pull/22/merge' did not match any file(s) known to git
/usr/bin/git checkout -b changeset-release/refs/pull/22/merge
Switched to a new branch 'changeset-release/refs/pull/22/merge'
/usr/bin/git reset --hard d6fbe8c8dc5[7](https://github.com/playon/components-stadium/actions/runs/7906010863/job/21579893443#step:5:8)19deb1ebd60e173ef1057[8](https://github.com/playon/components-stadium/actions/runs/7906010863/job/21579893443#step:5:9)a747cd
HEAD is now at d6fbe8c Merge 34437afcbe4e0356e24[9](https://github.com/playon/components-stadium/actions/runs/7906010863/job/21579893443#step:5:10)2aa6b74ff61518232a82 into 71c248d6dabd1521a6bcdc308aee3a7ab2612db0
/opt/hostedtoolcache/node/20.11.0/x64/bin/node /home/runner/work/components-stadium/components-stadium/node_modules/@changesets/cli/bin.js version
š¦ All files have been updated. Review them and commit at your leisure
/usr/bin/git status --porcelain
D .changeset/blue-impalas-swim.md
D .changeset/cyan-weeks-work.md
D .changeset/fluffy-yaks-jam.md
D .changeset/good-pens-swim.md
D .changeset/silly-cougars-bow.md
M CHANGELOG.md
M package.json
/usr/bin/git add .
/usr/bin/git commit -m Version Packages
[changeset-release/refs/pull/22/merge 9001c76] Version Packages
7 files changed, 17 insertions(+), 26 deletions(-)
delete mode [10](https://github.com/playon/components-stadium/actions/runs/7906010863/job/21579893443#step:5:11)0644 .changeset/blue-impalas-swim.md
delete mode 100644 .changeset/cyan-weeks-work.md
delete mode 100644 .changeset/fluffy-yaks-jam.md
delete mode 100644 .changeset/good-pens-swim.md
delete mode 100644 .changeset/silly-cougars-bow.md
/usr/bin/git push origin HEAD:changeset-release/refs/pull/[22](https://github.com/playon/components-stadium/actions/runs/7906010863/job/21579893443#step:5:23)/merge --force
remote:
remote: Create a pull request for 'changeset-release/refs/pull/22/merge' on GitHub by visiting:
remote: https://github.com/playon/components-stadium/pull/new/changeset-release/refs/pull/22/merge
remote:
To https://github.com/playon/components-stadium
* [new branch] HEAD -> changeset-release/refs/pull/22/merge
{
"total_count": 0,
"incomplete_results": false,
"items": []
}
creating pull request
Error: HttpError: Validation Failed: {"resource":"PullRequest","field":"base","code":"invalid"}
Error: Validation Failed: {"resource":"PullRequest","field":"base","code":"invalid"}
+1 Almost the same output as @MartinPlayon.
Adding more information. I would think it's something with permissions with GitHub.
I've added permissions as follows, and that fixes my issue.
permissions:
id-token: write
contents: write
checks: write
issues: write
packages: write
pull-request: write
In your case, not all of these must be required.
@BartoszKut, thank you for the info, but it doesn't look like the issue is there.
I think the problem lies in configuring the baseBranch
value. On an issue in the changeset repo when a developer's main branch doesn't have the latest, there can be an issue in resolving the correct version issue. The solution was to configure "baseBranch": "origin/main",
However, when creating the PR, it uses this value, and origin/
doesn't exist in GitHub actions. There should be a way to override the value to another branch if the default behavior is not the expected one.
I did find the issue. If you have set in your config.json the "baseBranch": "origin/main"
to point to the origin, then that is not a valid branch in the actions. However, it is not really well documented. I found in the code that there is a branch
value that can be passed to specify on which branch the action is running, and that will fix the HTTP error issue.
- name: Publish Package
id: changesets
uses: changesets/action@v1
with:
branch: main
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
You need check "public_repo" .
error log
realease yml