Wild guess based on this thread: The affected repositories could be configured with insufficient workflow permissions. This can only be checked by an admin who has access to repository settings @ErikSchierboom
Iām somewhat confused, as the settings seem to be correct for Python. Does it also not work for PRs that are opened by Exercism org members?
TBH, I am not sure what triggered the failure. The PR was opened by ryanplusplus
, and they are definitely an org member.
I havenāt seen the issue since on any PRs that Iāve opened or that Colin or others have opened, but none of those PRs touched any files that might need a [no important files changed]
tag.
I think there may be some syncing needed for the track, so when I get to it, Iāll look closer at what might be triggering failure.
I wonder if somehow it has to do with the fork not being synced or anything. Weird
Some more things to check.
Saw this today on CPP from a non-org member ;)
I checked that. Seems to be fine. I also double checked the permissions within the workflow, but I think theyāre set fine too.
I got hit with the same error HttpError: Resource not accessible by integration
again.
Very weird, after the PR to add github token in workflow, it has been smooth sailing until now.
I donāt understand why it suddenly stopped working. Thatās whatās weird too me.
Iāve went back and look at the two PRs that got the error, both were updating existing files : one change multiple test suite files, and the other change a test suite file and an example file.
Iāve also had new PR that added new contents: approaches and new exercise in between and after that didnāt encounter the error at all. I have another new exercise ready, Imma open it soon to see if this trend hold.
Not sure if this is enough to come to any conclusion though but it might help.
Well, the approaches PR wonāt cause the comment to be added because it wonāt cause the tests to run, so that will always succeed.
Well, new PR for exercise here went without a hitch.
Iām tempted to open one to just change existing test suite files to test the earlier hypothesis.
I think that would be really helpful
Reporting back, some simple changes in one just test suite file indeed failed the No important files changed check, same error as before:
HttpError: Resource not accessible by integration
Also I found out that subsequent commit of the same PR just donāt get the No important files changed check anymore, so I didnāt get to test for the stub file.
I suppose we sort of have a lead now. Good luck with the rest of it Erik.
(I already closed this but itās still there in case you want to take a look)
Weird, it worked for me: Upgrade to .NET 8 by ErikSchierboom Ā· Pull Request #2228 Ā· exercism/csharp Ā· GitHub But I have more permissions than others and did not use a fork.
@angelikatyborska IIRC, youāve built the PR commenter. Did you remember any issues with commenting on PRs from forks?
No, I see the PR commenter in action in the Elixir repos and it comments on PRs from forks all the time.
Okay, thatās good to know!
I think Iāve figured out how to fix this. The problem is that the current workflow response to pull_request
events, which are less secure than pull_request_target
events as the latter will always run the workflow as currently defined in the main
branch, whereas pull_request
events run the workflow as defined in the PRās branch itself. The GitHub docs mention this somewhere and also state that pull_request_target
workflows have more permissions, which makes them a better target for when one wants to comment on a PR. Iāll work on a fix.
Okay, Iāve created and tested a new version which seems to work well.
The code for it can be found here: https://github.com/exercism/prolog/blob/main/.github/workflows/no-important-files-changed.yml
Iāve changed a couple of things:
- Run on
.pull_request_target
events (notpull_request
). See https://github.com/exercism/prolog/blob/main/.github/workflows/no-important-files-changed.yml#L4 - Only run when changes are made to the
exercises/concept
orexercises/practice
tree. This is an easy way to skip running the workflow at the GitHub level, without us having to do anything. See https://github.com/exercism/prolog/blob/main/.github/workflows/no-important-files-changed.yml#L8-L9 - Ignore changes to files that weāll ignore anyway, like
.meta/config.json
and.docs/instructions.md
. This, again, works at the GitHub level in not even running our workflow when it isnāt needed. See https://github.com/exercism/prolog/blob/main/.github/workflows/no-important-files-changed.yml#L10-L13 - Removed the logic to check if the changed file is in the
exercises/concept
orexercises/practice
tree (which is guaranteed by the above paths filters).
Before Iāll ship this to all tracks, Iād really like for someone to test this on their track. Hopefully one of you (or several) would be willing to help out with this.