Running Code from Private Repo and Publishing Output to Pulic Repo Help #25614
-
Background: I have a private code repo that generates a CSV and I would like to publish/push that CSV to a public code repo using Workflows/Actions on a schedule. Problem: Once I get the CSV generated and into the public repository and try to push. I am getting a error of unable to access “repo” denied to github-actions[bot]. Any help will be appreciated, I tried to google a solution or work around. Below is the sample code:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
albert-marrero:
This means you’re using the To push to the public repository you’ll have to create a PAT that grants access for pushing to your public repository (repo scope), store it as a secret for your private repository, and provide that secret to |
Beta Was this translation helpful? Give feedback.
-
As much I don’t like to create a PAT that allows access to all my public repositories, this works greatly. Just to lock it down, I need to look into how to repo scope. |
Beta Was this translation helpful? Give feedback.
-
I meant the repo scope for tokens, see: Scopes for OAuth Apps - GitHub Docs I don’t think there’s a way to limit it to a specific repository, unfortunately. |
Beta Was this translation helpful? Give feedback.
This means you’re using the
GITHUB_TOKEN
for authorization when accessing the public repository. For fetching that’s no problem (because a public repo can be fetched by anyone), but pushing won’t work because theGITHUB_TOKEN
is scoped to your private repository.To push to the public repository you’ll have to create a PAT that grants access for pushing to your public repository (repo scope), store it as a secret for your private repository, and provide that secret to
actions/checkout
as itstoken
option.