Can I edit the main.workflow github-actions file locally?

Asked in StackOverflow.

If I change my main.workflow file locally, not in the master branch, the commit and push the change, I get this error from push command:

> git diff
diff --git a/.github/main.workflow b/.github/main.workflow
index 135d8ea..0a13a28 100644
--- a/.github/main.workflow
+++ b/.github/main.workflow
@@ -6,7 +6,7 @@ workflow "Build and Test in PR" {
   ]
 }

-action ".NET Core CLI" {
+action ".NET Core CLI" {
   uses = "./.github/net-core/"
   args = "test"
 }

> git push
! [remote rejected] my-branch -> my-branch (refusing to allow an integration to create or update .github/main.workflow)
error: failed to push some refs to 'https://github.com/my-user-name/my-repo.git'
1 Like

HI @baruchiro,

Thanks for being here! If you are using GitHub desktop there is currently a bug that causes this error when attempting to push commits from GitHub Actions. As a workaround, you can use the Git API until the fix for this issue is released.

Since the issue used for tracking this bug is not external to the public, I would recommend checking in with us again in a week or two for an update.

2 Likes

I’m afraid I did not quite understand.
As you can see, I did not use Github Desktop but Git CLI.

1 Like

Hi @baruchiro ,

You’re probably using a Git client of some sort which is using an OAuth token to pull/push to Github. I would suggest updating upstream to use ssh or https with your own credentials / personal access tokens instead of OAuth tokens given to third-party apps.

1 Like

Yes, the main.workflow can be edited locally and changes pushed to the GitHub-hosted repository. The error message doesn’t mean exactly what you’re describing though:

refusing to allow an integration to create or update .github/main.workflow

An “integration” is a GitHub App, typically. Additionally, the GITHUB_TOKEN that is supplied to Actions is a GitHub App token, so if you were using an Action to modify main.workflow then this would be one reason you’re getting the error you show.

But as a real user, not a GitHub App or Action, you modified main.workflow locally and have write access to the repository and branch you’re pushing to, yes, you can modify main.workflow locally to your heart’s content :grinning:

I hope that helps!

2 Likes

Hi @AndreaG,

> Since the issue used for tracking this bug is not external to the public, I would recommend checking in with us again in a week or two for an update.

I’m running into this issue, and curious if there’s any news on the fix from GitHub’s side?

Thanks,

-Eric

I’m observing this through git command line. Marking this issue as solved is very misleading.

5 Likes

Thanks for the explanation!

Is there a way to allow permission for an ‘Integration’ (in my case a restyle bot) permission to modify workflow?

Log: https://restyled.io/gh/hXtreme/repos/HCP-Project/jobs/140246

For the interested, I got the error trying to push from VS, but not from the terminal, (I am using signed commits). OS: Ubuntu.