If an app pushes to a repository it authors the pushes with fake APP_NAME[bot] user. Right now GitHub API doesn't respect such usernames. Either we should find a workaround or GitHub API should start supporting such usernames.
I've contacted GH support about the issue and will update this issue.
Appreciate you following up on this, @fkorotkov. :+1:
Blocked on GitHub Support response since I don't see a viable workaround on how to check permissions of an app from another app. 馃槳
GitHub support confirmed that there is no way to check permissions of other apps. I wonder now if it's feasible to assume some permissions for such apps. I will hold on that for now seems it looks more like a hack rather than a solution. I will try to push for GitHub's support through other channels for integrators and ideally it will be fixed upstream.
@fkorotkov hey, I was wondering if you had any update on this and/or know of a workaround? I ran into the problem again for a different project.
If there's a way to unconditionally use the repo owner's compute credits for particular branches no matter what, that'd be an okay workaround for now. (I specifically need it for 3 branches: master, staging, trying.)
On the second thought it seems safe to remove the enforcement of a user being a collaborator or having a write access to a repository for non-PR builds. If a user initiated a non-PR build then definitely the user has permissions and in that case the fake users created for Apps will work. 馃
yeah, since non-PR builds mean they have push access, I think it'd make sense to allow use of compute credits.
And if that's allowed, then I think my original attempt from #280 may work for allowing PRs from collaborators + a certain collection of branches to use compute credits:
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' || $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH == 'staging' || $CIRRUS_BRANCH == 'trying'
This should be working now. 馃檶
Most helpful comment
This should be working now. 馃檶