-
-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The workflow fails to run #266
Comments
Hi there The output the Action produces isn't great here. The output is not related to As you probably saw, this is the actual error:
You use custom permissions in your workflow file. During the run the You have 2 options: Update your workflow to use name: "Prettier"
on:
push:
branches: ["main"]
jobs:
fix:
name: Fix formatting issues
runs-on: ubuntu-latest
permissions:
actions: write
contents: write
security-events: write
+ workflows: write
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- uses: actionsx/prettier@v2
with:
# prettier CLI arguments.
args: --write .
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Prettified Code Update your Prettier settings to not update |
@stefanzweifel can you help me with this? |
Silly me thought A quick internet search for "refusing to allow a GitHub App to create or update workflow" shows results that all point to personal access tokens:
If you really need your workflow to change other workflow files, you need to create a new personl access token, add it as a secret to the repository and then reference it in the See README for details: https://github.com/stefanzweifel/git-auto-commit-action#commits-made-by-this-action-do-not-trigger-new-workflow-runs |
I tried those and didn't work as I expected. So, I took a silly approach but works I added run: echo ".github" > ".prettierignore" then before running auto commit. I added run: rm ".prettierignore" and I prettify the workflow files manually.
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Stefan Zweifel ***@***.***>
Sent: Friday, December 2, 2022 2:35:49 PM
To: stefanzweifel/git-auto-commit-action ***@***.***>
Cc: Moheshwar Amarnath Biswas ***@***.***>; Author ***@***.***>
Subject: Re: [stefanzweifel/git-auto-commit-action] The workflow fails to run (Issue #266)
Silly me thought workflows is a supported permission. Doesn't seem so. (Docs<https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs>)
A quick internet search for "refusing to allow a GitHub App to create or update workflow" shows results that all point to personal access tokens:
* https://stackoverflow.com/questions/66643917/refusing-to-allow-a-github-app-to-create-or-update-workflow#comment117813960_66644086
* community/community#27072
* aormsby/Fork-Sync-With-Upstream-action#44<aormsby/Fork-Sync-With-Upstream-action#44>
If you really need your workflow to change other workflow files, you need to create a new personl access token, add it as a secret to the repository and then reference it in the actions/checkout step (not in git-auto-commit)
See README for details: https://github.com/stefanzweifel/git-auto-commit-action#commits-made-by-this-action-do-not-trigger-new-workflow-runs
—
Reply to this email directly, view it on GitHub<#266 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/APTOM2LRZ2FSVEA2NBOT2ULWLGYGLANCNFSM6AAAAAASP2FJ7M>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
for future reference I fixed this by creating a new PAT, gave it steps:
- name: ⚙️ Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
token: ${{ secrets.WORKFLOW_TOKEN }} |
Thank you |
git-auto-commit Version
v4.15.4
Machine Type
Ubuntu (eg. ubuntu-latest)
Bug description
The workflow fails to run and logs INPUT_PUSH_OPTIONS:
To https://github.com/fluentmoheshwar/fluentmoheshwar-site
! [remote rejected] main -> main (refusing to allow a GitHub App to create or update workflow
.github/workflows/codeql.yml
withoutworkflows
permission)error: failed to push some refs to 'https://github.com/fluentmoheshwar/fluentmoheshwar-site'
Error: Invalid status code: 1
Steps to reproduce
Create a workflow like the example.
Run it.
Tried solutions
No response
Example Workflow
Relevant log output
The text was updated successfully, but these errors were encountered: