Skip to content

Pushing to repo fails... possibly related to publishing to GPR? #106

Description

@airtonix

Heya Guys, I have this little library within which I'm trying to implement changesets.

Initially I wanted to just process changesets, bump versions and publish new npm package when master changes, although now I realise that due to #77 it could be unfeasible?

In any case, I'm now just trying to get it working in the first place, so it goes through the pull request flow.

Variation on my situation is that my npm repo is the github package repository and I'm using pnpm and asdf (if that matters).

Error I'm getting when i merge the PR is

Run changesets/action@master
setting git user
/usr/bin/git config --global user.name "github-actions[bot]"
/usr/bin/git config --global user.email "github-actions[bot]@users.noreply.github.com"
setting GitHub credentials
/usr/bin/git checkout changeset-release/master
error: pathspec 'changeset-release/master' did not match any file(s) known to git
/usr/bin/git checkout -b changeset-release/master
Switched to a new branch 'changeset-release/master'
/usr/bin/git reset --hard a161afe0ea081204ad93acab4603305f476a04d4
HEAD is now at a161afe Implement Changesets Release Flow (#4)
/home/runner/.asdf/shims/node /home/runner/work/lootr/lootr/node_modules/.pnpm/@[email protected]/node_modules/@changesets/cli/bin.js version
🦋  All files have been updated and committed. You're ready to publish!
/usr/bin/git status --porcelain
/usr/bin/git push origin HEAD:changeset-release/master --force
remote: Permission to airtonix/lootr.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/airtonix/lootr/': The requested URL returned error: 403
Error: The process '/usr/bin/git' failed with exit code 128
    at a._setResult (/home/runner/work/_actions/changesets/action/master/dist/index.js:86:6638)
    at a.CheckComplete (/home/runner/work/_actions/changesets/action/master/dist/index.js:86:6068)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/changesets/action/master/dist/index.js:86:5102)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
Error: The process '/usr/bin/git' failed with exit code 128

You can see it here : https://github.com/airtonix/lootr/runs/3391442726?check_suite_focus=true#step:7:26

my workflow file is here: https://github.com/airtonix/lootr/blob/8e004098ce7c8834769f0680db88f9f7f57c19d8/.github/workflows/release.yml

something to note, is that previous to bring in changesets, my pnpm publishing required the use of setting a NODE_AUTH_TOKEN due to actions/setup-node@v2 creating a .npmrc for me.

Activity

  1. Andarist commented on Aug 22, 2021

    @Andarist
    Member

    It looks like the action was not able to push out to the changeset-release/master branch and this is what caused the problem. I'm not sure why this would happen though - maybe you have some branch protection rules that prevent force-pushing?

  2. airtonix commented on Nov 16, 2021

    @airtonix
    Author

    coming back to this again... forgot i made this ticket and am again experiencing this issue.

    No idea what that branch (changeset-release/master) is ... i didn't create it, didn't ask for it. no idea what it is.

    Initially when I saw that I thought it was mistakenly trying to push back to https://github.com/changesets/action master branch?

  3. Andarist commented on Nov 16, 2021

    @Andarist
    Member

    Since you have configured Changesets action to be run on your master branch it creates a dedicated "version branch" for it (changeset-release/master in this case) and tries to push to it so it could create a PR to your master branch. When such PR gets merged into your master branch then the actual release "kicks in" and packages are published to the registry.

    As to the usage without a pull request workflow - I'm unsure how to handle this right now because the changeset files have to be removed somehow from your repository and currently they are usually removed within that versioning PR. It's an interesting use case and I might look into it sometime in the future but I can't promise that it will be done any time soon. If you have any idea on how this could work - let me know, I'll try to consider it.

  4. zthxxx commented on Jan 6, 2022

    @zthxxx

    Hey @airtonix and @Andarist , I found out the reason with details and wrote in #132

  5. hcg1023 commented on Apr 29, 2022

    @hcg1023

    I have the same problem, I ran into the same problem, and instead of using npm, I simply used the first example of the README.md Without Publishing

  6. hcg1023 commented on Apr 29, 2022

    @hcg1023

    I solved the problem. Maybe you can try my method

     - name: Checkout Repo
            uses: actions/checkout@v3
            with:
              fetch-depth: 0
              persist-credentials: false
  7. hcg1023 commented on May 6, 2022

    @hcg1023

    #179 Maybe you need confirm this

  8. maoxiaoke commented on May 7, 2022

    @maoxiaoke

    @hcg1023 this solved my problem. Workflows need more permissions.

  9. NullVoxPopuli commented on Jan 30, 2023

    @NullVoxPopuli

    I just ran in to this and had to additionally set these permissions:

    setting workflow permissions on the /settings/actions page for the GITHUB_TOKEN to have "read and write" permissions instead of just "read"

    at this URL: https://github.com/<the-repo>/settings/actions

  10. andrewbranch commented on Jun 11, 2023

    @andrewbranch

    ☝️ the defaults for new repos and orgs definitely cause this failure. This should be in the docs.

  11. ryangoree commented on Feb 12, 2024

    @ryangoree

    If you don't want to give all actions read/write by default: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idpermissions

    ...
    
    jobs:
      release:
        name: Release
        runs-on: ubuntu-latest
    +    permissions: write-all
        steps:
          - name: Checkout Repo
          # ...
  12. added theissue type on May 15, 2026
  13. bluwy commented on Sep 4, 2026

    @bluwy
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions