#SharePointProblems | Koskila.net

Solutions are worthless unless shared! Antti K. Koskela's Personal Professional Blog
>

How to resolve "refusing to allow an integration to create or update .github/workflows/main.yml" on GitHub Desktop?

koskila
Reading Time 2 min
Word Count 324 words
Comments 4 comments
Rating 5 (2 votes)
View

This article explains how to fix a weird and surprising error about GitHub Actions workflow file thrown at you when you try to push your changes using GitHub Desktop. The odd part is that you had no changes to the workflow file at all.

Problem

Ran into this one when trying to push my merge from upstream. I was adhering to my own instructions (see below for a link), but got the error (further below) that stopped me from using GitHub Desktop to push (sync) at all.

https://www.koskila.net/how-to-git-merge-upstream/

So, the error I ran into:

! [remote rejected] master -> master (refusing to allow an integration to create or update .github/workflows/main.yml)
error: failed to push some refs to [repositoryname]

This was pretty weird - I hadn't made any changes to said file, and I don't think anyone else had, either.

This is likely an unintended feature of GitHub, and GitHub Desktop can't do anything about it. However, there's a nifty workaround available!

Solution

A number of GitHub issues propose that this issue can be circumvented by actually committing a change removing the yaml file in question from the repository. However, if you're merging from an upstream repository, you don't usually want to do this! And actually, if it's an actual workflow file that you like, why would you remove it anyway?

So, we need to find another way.

Whereas GitHub Desktop is using OAuth, and running into this issue, Git Bash (the console application you use to merge upstream in my earlier example as well) doesn't. And it's also free from this issue, as it's not considered "an integration", and whatever it's trying to do (or not do) to the yaml file just works.

So, in short - instead of using GitHub Desktop, open Git bash and run this:

cd [yourprojectpath] # after this, make sure the command line shows the right branch name!
git push

Et voila! You should be good.

References

Comments

Interactive comments not implemented yet. Showing legacy comments migrated from WordPress.
Philip
2019-10-30 12:06:58)
I have the same problem in Git Bash on Windows 10. Any other suggestion?
2019-10-31 12:27:28
Hi Philip, Is the repository one where you can in fact remove the workflows/main.yaml file? This issue describes that as a workaround: https://github.com/cclauss/Upgrade-to-Python3/issues/1 Are you merging or just pushing? Oh, also: congrats on writing the 400. comment ever on my blog!