Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to push to branch when using a GitHub app token #612

Open
zeshuaro opened this issue Jan 5, 2025 · 3 comments
Open

Failing to push to branch when using a GitHub app token #612

zeshuaro opened this issue Jan 5, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@zeshuaro
Copy link

zeshuaro commented Jan 5, 2025

Describe the bug

When using the token generated by actions/create-github-app-token and provided as the token parameter, the action fails with the following error:

Run FantasticFiasco/[email protected]
  with:
    token: ***
    commitTitle: docs(license): update copyright year to {{ currentYear }}
    prTitle: docs(license): update copyright year to {{ currentYear }}
    labels: documentation
    path: LICENSE
    branchName: license/copyright-to-{{currentYear}}
    commitAuthorName: github-actions
    commitAuthorEmail: [email protected]
Working directory: /home/runner/work/firestore_cache/firestore_cache
Current year is "[2](https://github.com/zeshuaro/firestore_cache/actions/runs/12608914191/job/35141891620#step:4:2)025"
Checkout new branch named "license/copyright-to-2025"
Found 1 file(s) matching the path "LICENSE"
Update license in "./LICENSE"
Error: Error pushing changes to new branch: Command failed: git push --set-upstream origin license/copyright-to-202[5](https://github.com/zeshuaro/firestore_cache/actions/runs/12608914191/job/35141891620#step:4:5)
fatal: could not read Username for 'https://github.com': No such device or address

To Reproduce

Use the following workflow with a GitHub app details:

jobs:
  update-license:
    name: Update license year
    runs-on: ubuntu-latest

    steps:
      - name: Create GitHub App token 🔑
        id: app-token
        uses: actions/create-github-app-token@v1
        with:
          app-id: ${{ secrets.GH_APP_ID }}
          private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

      - name: Checkout 🛎️
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          token: ${{ steps.app-token.outputs.token }}
          persist-credentials: false

      - name: Update license year 🪪
        uses: FantasticFiasco/[email protected]
        with:
          token: ${{ steps.app-token.outputs.token }}
          commitTitle: "docs(license): update copyright year to {{ currentYear }}"
          prTitle: "docs(license): update copyright year to {{ currentYear }}"
          labels: documentation

Expected behavior

The workflow should work with a GitHub app token

Screenshots

See this example workflow: https://github.com/zeshuaro/firestore_cache/actions/runs/12608914191/job/35141891620

Desktop (please complete the following information):

  • OS: ubuntu
  • Version 3.0.2

Additional context

N/A

@zeshuaro zeshuaro added the bug Something isn't working label Jan 5, 2025
Copy link
Contributor

github-actions bot commented Jan 5, 2025

Hi there and welcome to this repository!

A maintainer will be with you shortly, but first and foremost I would like to thank you for taking the time to report this issue. Quality is of the highest priority for us, and we would never release anything with known defects. We aim to do our best but unfortunately you are here because you encountered something we didn't expect. Lets see if we can figure out what went wrong and provide a remedy for it.

@FantasticFiasco
Copy link
Owner

Hi @zeshuaro and thanks for reporting the issue!

I've added this issue to my list of things to do, but cant unfortunately start working on it right now. In order for this to be efficient, and since the environment to reproduce this is challenging, could you please provide complete instructions on how to setup the environment, please bear in mind that I don't have a GitHub app. A quick glance tells me that the workflow exists in an external repo, would that be a factor in this issue or can this be reproduced in one repository?

@zeshuaro
Copy link
Author

You can follow the GitHub docs to create an app of your own. Once you have created the app, you can obtain its app ID and secret which can then be specified to the example workflow I shared above to reproduce the problem in any repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants