Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 7

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

Solved! Go to Solution.

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'

 

6 Replies
Solution
Community Manager
Message 2 of 7

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

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.


Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Copilot Lvl 2
Message 3 of 7

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

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

Copilot Lvl 2
Message 4 of 7

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

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

Copilot Lvl 3
Message 5 of 7

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

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

wei
Pilot Lvl 2
Message 6 of 7

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

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.

 

Community Manager
Message 7 of 7

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

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 😀

 

I hope that helps!