-
Notifications
You must be signed in to change notification settings - Fork 50
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
Caught error trying to update branch: Resource not accessible by integration #19
Comments
Hey @shobhitagarwal1612 - this might be because the source branch (where the changes are being pulled form) are in a separate repository and the token you've provided to autoupdate doesn't have access to write to that repository. If this is the case, one possible workaround is to create a personal access token that has write access to both repositories and pass that in instead. I've personally set some repositories up like this due to similar limitations. To obtain a valid access token follow this link and make sure it has access to both repositories: https://github.com/settings/tokens/new?scopes=repo&description=autoupdate-action Then add this to the repository that has autoupdate installed as a secret - https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets (remember the name you give this secret, you'll need it below!) Finally, change the i.e. instead of: env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" you'd do: env:
GITHUB_TOKEN: "${{ secrets.MY_SECRET_NAME }}" Let me know how you go! |
@chinthakagodawita Thanks for the quick reply! So this needs to be done for each of the forked repositories that have opened PR to the base repo, right? It doesn't seem feasible for an open source project where the number of contributors vary a lot. |
Yes, unfortunately that is a limitation of how actions operate - they have to authenticate somehow, either using a personal access token generated by a Github account or via the auto-generated token on the repository. For autoupdate to work, it needs access to write to the PR's branch. You could try the following, instead of running on an event trigger, this will run the update on a schedule. This gets around the limitation where the base branch push event originates on a different repository than the PR branch. It also requires the
name: autoupdate
on:
# This will trigger every 30mins (tweak this as required)
schedule:
- cron: '*/30 * * * *'
jobs:
autoupdate:
name: autoupdate
runs-on: ubuntu-18.04
steps:
- uses: docker://chinthakagodawita/autoupdate-action:v1
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
Hi @chinthakagodawita, I have a follow-up question it seems that after trying to work forked PR which is very common in opensource the bot just dies, right? so even there are other PR it could resolve it just stop with reaching the first difficult PR... just for the record, created a new issue: #100 |
Hey @chinthakagodawita , Am I missing something? |
Hey @RishabhJain2018, autoupdate doesn't currently support the |
Hey. We were trying out the action in our project and it doesn't update the branch in PR (which belongs to a forked project) whenever a commit gets pushed to the repository.
I see the following error in the
Actions
tabWe are using the default yml config as mentioned in the documentation
Is this a limitation of this Github Action? Any help is really appreciated. Thanks!
The text was updated successfully, but these errors were encountered: