Workflow to suggest `[no important files changed]`

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.

1 Like

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. :sweat_smile:

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!

The joys of CI: Commits Ā· exercism/prolog Ā· GitHub!

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.

1 Like

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:

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.