GitHub Actions uses CI workflows on develop instead of those in my current branch

GitHub Actions is using the versions of the workflow YML files that are in our project’s default branch (develop) instead of the steps that are defined in the yml files the branch is running CI under. Can I stop this?

This is causing problems when the CI steps on develop refer to shell scripts that don’t exist in the branch under question.

That depends on the events you are using to trigger the workflows. Each event is associated with a git ref, and workflow files are searched at that ref (or the default branch for the very few exceptions). You can see what the ref is for each event in the Events that trigger workflows documentation, for each event the ref is listed in the GITHUB_REF column.

For example, for a push event you can see it says “updated ref” on the very right:

If the workflow files that get used aren’t the ones present at the event ref that might be a bug.