-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Refusing to allow a GitHub App to create or update workflow .github/workflows/main.yml
without workflows
permission
#322
Comments
Hi @atodorov, As far as I know, the default token used by GitHub Actions can't have (I can't find documentation about this, but I ran into a similar issues years ago) The easiest solution might be to create a personal access token (PAT) and add it to your workflow. Will add a warning to the README to warn users, that the action can't modify workflow files. |
Sadly I wasn't able to find documentation either and trying to set
is invalid syntax. |
I also assume that the error message "refusing to allow a GitHub App to create or update workflow GitHub probably assumes that the push comes from a GitHub App, but GitHub Actions is not the same as a GitHub App. Maybe we can forward this to a feedback repo somewhere. 🤔 |
FTR I think in this case GitHub is correct. My commit (after I excluded the conflicting files) looks like this:
Where https://github.com/apps/github-actions redirects to https://github.com/features/actions. Internally |
@atodorov This seems like a reasonable explanation. 👍 Back to your original issue, have you tried the approach with a personal access token? I'm fairly certain that this will resolve your issue. Can try to reproduce this on my end in the coming days/weeks. |
See #266 (comment) for detail on creating and scoping a PAT for this. Also #87 (comment) for the nuclear option. They discuss setting up your own GitHub App to reliably commit to protected branches, but this "create an entire app and jump through lots of auth hurdles" approach would also apply to permitting a bot to do workflow editing. Maybe only worth it at scale across repos in a GitHub Org where PATs are forbidden. |
b/c we need a personal access token here in order for this to work, see stefanzweifel/git-auto-commit-action#322
b/c we need a personal access token here in order for this to work, see stefanzweifel/git-auto-commit-action#322
* initial * remove docker creds and push for testing * remove docker creds and push for testing * add temp credentials * add temp credentials * add temp credentials * add checkout step * update copy command * wip * wip * testing build of dockerfile * testing dockerfile * updated README.md * initial commit * added active validator functionality with pablo * updated yaml workflows * updated yaml workflows * Update devnet.dockerfile * fix: update how we copy over the secrets * Update devnet.yml * Update devnet.yml * Update devnet.yml * Switch Docker context!!! * one repo for images, different tags for dev-mainnet * ability to manually trigger * run this branch * fix added the wrong networks * ready for pr * updated workflows to use correct context * Update testnet.yml * Update testnet.yml * removed dynamic validator list functionality * add: testnet validator list * add: env files, devnet stashes & remove from gitignore * rm: config step from testnet & devnet workflows * add: default stash in config * updated runtime to fully execute batch payouts * removed unused logging messages * more cleanup * reverted unneeded changes to sleep timing * update: devnet config & stashes * docker images are built on release/* branch (#15) * Enable pre-commit CI * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Enable MegaLinter - disable Clippy b/c it will be enabled separately as part of several other cargo CI jobs - disable spell checkers - too many false positives * Update README files to satisfy linters * Revert "initial" to bring back deleted LICENSE file This reverts commit ca51756. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix issues reported by ShellCheck - must use double quotes * Configure top-level permissions in GHA to read-all * Ignore git leaks from upstream commits * Improvements to Dockerfile(s) - ignore The instruction 'RUN <package-manager> update' should always be followed by '<package-manager> install' in the same RUN statement. See https://avd.aquasec.com/misconfig/ds017 which is triggered by `rustup update` * removed references to the unused matrix.rs module * remove matrix.rs for megalinter * add .jscpd.json configuration file and set threshold to 5 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updated .jscpd.json config * added a healtcheck to the crunch bot and added instructions to the dockerfile * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update the correct dockerfiles this time * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add a git diff as part of MegaLinter's auto-commit output b/c we need a personal access token here in order for this to work, see stefanzweifel/git-auto-commit-action#322 * Reformat * Rename release related workflow to release.yml * Copy over create_release.yml from upstream again where their tests are because previous commits didn't leave this file alone but rather made lots of changes into it and then subsequently removed it. * Rename upstream create_release.yml into ci.yml will add subsequent changes here to make tests trigger on each PR however this is a good starting point * Enable minimal testing on PRs - cargo check - cargo clippy - cargo fmt - cargo test * Reformat with cargo fmt * Stricter checks in CI * Remove unused imports * Silence warnings for unused variables for the upstream code just prefix them with underscore to minimize differences, for creditcoin/ just remove them * Remove unnecessary mut * Allow 2 unused methods from upstream implementation * Add rust-toolchain.toml and use the same rustc version in CI because fmt and clippy appear to be slightly different from version to version and we'd like to have consistency regardless of how or where this is built * Reformat again with rustc 1.77.0 * Apply suggestions from clippy * Adjust CRUNCH_CONFIG_FILENAME to point to an existing file because .env.example has been removed in ca51756 * Collect and upload code coverage when executing unit tests * Enable Dependabot * Bump taiki-e/install-action from 2.27.14 to 2.32.7 Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.27.14 to 2.32.7. - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](taiki-e/install-action@v2.27.14...v2.32.7) --- updated-dependencies: - dependency-name: taiki-e/install-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Bump azure/login from 1 to 2 Bumps [azure/login](https://github.com/azure/login) from 1 to 2. - [Release notes](https://github.com/azure/login/releases) - [Commits](Azure/login@v1...v2) --- updated-dependencies: - dependency-name: azure/login dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * Update base64 requirement from 0.13.0 to 0.22.0 Updates the requirements on [base64](https://github.com/marshallpierce/rust-base64) to permit the latest version. - [Changelog](https://github.com/marshallpierce/rust-base64/blob/master/RELEASE-NOTES.md) - [Commits](marshallpierce/rust-base64@v0.13.0...v0.22.0) --- updated-dependencies: - dependency-name: base64 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Update env_logger requirement from 0.9.3 to 0.11.3 Updates the requirements on [env_logger](https://github.com/rust-cli/env_logger) to permit the latest version. - [Release notes](https://github.com/rust-cli/env_logger/releases) - [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md) - [Commits](rust-cli/env_logger@v0.9.3...v0.11.3) --- updated-dependencies: - dependency-name: env_logger dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Update async-recursion requirement from 0.3.2 to 1.1.0 Updates the requirements on [async-recursion](https://github.com/dcchut/async-recursion) to permit the latest version. - [Release notes](https://github.com/dcchut/async-recursion/releases) - [Commits](dcchut/async-recursion@v0.3.2...v1.1.0) --- updated-dependencies: - dependency-name: async-recursion dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Update reqwest requirement from 0.11 to 0.12 Updates the requirements on [reqwest](https://github.com/seanmonstar/reqwest) to permit the latest version. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](seanmonstar/reqwest@v0.11.0...v0.12.2) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * chore: remove PORT from RPC url (#31) * Update Dockerfile rustup doesnt work * fix dockerfile * Dockerfile fix pls * taking off silent to debug * certificates fix * reverting changes * Update devnet.dockerfile * Update devnet.dockerfile * fix certificates * fixing other dockerfiles * needs port --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Zachary Frederick <[email protected]> Co-authored-by: Zach Frederick <[email protected]> Co-authored-by: Pablito Labarta <[email protected]> Co-authored-by: Alex Todorov <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: frank <[email protected]> Co-authored-by: Thomas McDonald <[email protected]>
I've updated the troubleshoot section in the README with a section that discussions this problem. |
git-auto-commit Version
v5
Machine Type
Ubuntu (eg. ubuntu-latest)
Bug description
I have configured
permission: write-all
and still get a failure because part of the commit is modifying GitHub actions files.Steps to reproduce
https://github.com/kiwitcms/gitops/actions/runs/8056214742/job/22004837145?pr=5
Tried solutions
No response
Example Workflow
extracted from https://github.com/kiwitcms/gitops/pull/5/files
The text was updated successfully, but these errors were encountered: