Skip to content

Unable to checkout repo with this action workflow #115

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

Closed
iamatib opened this issue Mar 18, 2024 · 7 comments
Closed

Unable to checkout repo with this action workflow #115

iamatib opened this issue Mar 18, 2024 · 7 comments

Comments

@iamatib
Copy link

iamatib commented Mar 18, 2024

I am trying to checkout repo i github enterprise with this workflow, but i am getting the error as
Retrieving the default branch name Not Found
while i looked some other third party workflows, it worked.
eg: https://github.com/peter-murray/workflow-application-token-action

could you please help us here
Regards,
Atib

@gr2m
Copy link
Contributor

gr2m commented Mar 18, 2024

Can you please setup a public repository that reproduces the problem? We can't help you with the information you provided. We use this action ourselves in conjunction with actions/checkout, so it definitely works.

@iamatib
Copy link
Author

iamatib commented Mar 19, 2024

Hello @gr2m
Thanks For you reply.
https://github.com/iamatib/checkout-demo/actions

I have setup here, could you please have a look.
The github app has "read" permission to all repo's.

I am trying checkout a private repo from the this repo https://github.com/iamatib/checkout-demo

could you please have a look.

Thanks in Advance.

Regards,
Atib

@gr2m
Copy link
Contributor

gr2m commented Mar 19, 2024

You are trying to checkout iamatib/checkout-test from iamatib/checkout-demo, but the token that gets created only has access to the current repository unless you set owner and/or repositories. In your case, try this

  on: [workflow_dispatch]

  jobs:
    hello-world:
      runs-on: ubuntu-latest
      steps:
        - uses: actions/create-github-app-token@v1
          id: app-token
          with:
            app-id: ${{ vars.APP_ID }}
            private-key: ${{ secrets.PRIVATE_KEY }}
+           repositories: 'checkout-test`
        - name: Checkout Repository
          uses: actions/checkout@v3
          with:
            token: ${{ steps.app-token.outputs.token  }}
            repository: iamatib/checkout-test

@iamatib
Copy link
Author

iamatib commented Mar 20, 2024

Hello @gr2m

Thank You, I thought when we give permissions for repo's in Github App, it should already be authenticated to run api's.
Yeah, now i got it why it was not working.

Will close the Issue.

Regards,
Atib

@iamatib iamatib closed this as completed Mar 20, 2024
@iamatib
Copy link
Author

iamatib commented Mar 20, 2024

Hi @gr2m

could we also rotate this private key in timely manner? is the rotation possible ?

Thanks in Advance.
Regards,
Atib

@gr2m
Copy link
Contributor

gr2m commented Mar 20, 2024

is the rotation possible ?

I don't think it's possible to programmatically change a GitHub App's private keys unfortunately. Repository secrets can be rotated though.

@iamatib
Copy link
Author

iamatib commented Mar 20, 2024

Thank You again..!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants