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'
In your repository, browse to the workflow file you want to edit. In the upper right corner of the file view, to open the workflow editor, click . To the right of the editor, use the GitHub Marketplace sidebar to browse actions.
github/workflows/ files (or for any changes to embedded GitHub actions), you can use act to run the actions locally. The environment variables and filesystem are all configured to match what GitHub provides. Local Task Runner - I love make.
Workflows are defined in the . github/workflows directory in a repository, and a repository can have multiple workflows, each of which can perform a different set of tasks.
GitHub Actions uses YAML syntax to define the workflow. Each workflow is stored as a separate YAML file in your code repository, in a directory named .github/workflows .
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Actions. In the left sidebar, click the workflow you want to see. Under "Workflow runs", click the name of the run you want to see.
Still experiencing this, even with .yml
workflow files. Turns out that for me it was due to me using an HTTPS remote instead of SSH.
To work around this issue in the Github API, I simply used an SSH remote instead of HTTPS.
You can see if you are using HTTPS or SSH by
$ git remote -v
> origin https://github.com/USERNAME/REPOSITORY.git (fetch)
> origin https://github.com/USERNAME/REPOSITORY.git (push)
Notice if there is a https://
instead of git
(SSH).
Then do
git remote set-url origin [email protected]:USERNAME/REPOSITORY.git
Then verify the change
$ git remote -v
# Verify new remote URL
> origin [email protected]:USERNAME/REPOSITORY.git (fetch)
> origin [email protected]:USERNAME/REPOSITORY.git (push)
Further Reading: Github Docs on Switching remote URLs from HTTPS to SSH
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With