Compare commits

..

10 Commits

Author SHA1 Message Date
Stefan Zweifel
050015d406
Add Scope/Permissions documentation for PATs
Some checks failed
Lint Code Base / Lint Code Base (push) Failing after 4s
git-auto-commit / git-auto-commit (push) Successful in 8s
Release Drafter / update_release_draft (push) Failing after 5s
tests / tests (push) Failing after 7s
Closes #347
2024-10-06 10:39:09 +02:00
scarf
573710f3d0
docs(README): fix broken protected branch docs link (#346) 2024-10-04 08:56:00 +02:00
Marcelo Trylesinski
e961da7576
Update README.md (#343) 2024-09-22 16:50:21 +02:00
dependabot[bot]
ac8823709a
Bump github/super-linter from 6 to 7 (#342)
Bumps [github/super-linter](https://github.com/github/super-linter) from 6 to 7.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/super-linter/compare/v6...v7)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 08:16:51 +02:00
dependabot[bot]
be823a7e51
Bump github/super-linter from 5 to 6 (#335)
Bumps [github/super-linter](https://github.com/github/super-linter) from 5 to 6.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/super-linter/compare/v5...v6)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 08:26:25 +02:00
Stefan Zweifel
55a82ca24f
Add Section on preventing infinite loops to README 2024-07-06 15:14:44 +02:00
Stefan Zweifel
18157e6f3b
Update bug.yaml 2024-07-06 12:07:25 +02:00
Stefan Zweifel
7d779d0067
Update Bug Repo Form 2024-07-06 12:06:47 +02:00
Stefan Zweifel
efd424db0f
Fix link to "new feature request" 2024-07-06 12:00:09 +02:00
Stefan Zweifel
5f3fa8aed3
Add docs about .github/workflows pushes
See #322
2024-07-06 11:43:22 +02:00
4 changed files with 33 additions and 9 deletions

View File

@ -5,7 +5,7 @@ body:
- type: markdown - type: markdown
attributes: attributes:
value: | value: |
Before opening a bug report, please search for the behaviour in the existing issues. Before opening a bug report, please search for the behaviour in existing issues or discussions.
--- ---
@ -17,7 +17,7 @@ body:
description: "Which exact version of git-auto-commit are you using in your Workflow?" description: "Which exact version of git-auto-commit are you using in your Workflow?"
placeholder: "v4.14.0" placeholder: "v4.14.0"
validations: validations:
required: true required: true
- type: dropdown - type: dropdown
id: machine id: machine
attributes: attributes:
@ -33,7 +33,7 @@ body:
id: bug-description id: bug-description
attributes: attributes:
label: Bug description label: Bug description
description: What exactly happened? description: What exactly happened? Please describe your problem in detail.
validations: validations:
required: true required: true
- type: textarea - type: textarea
@ -52,7 +52,7 @@ body:
id: example-workflow id: example-workflow
attributes: attributes:
label: Example Workflow label: Example Workflow
description: Please share your GitHub Actions workflow which causes the bug. We use this to reproduce the error. No need for backticks here. description: Please share the YAML-code of your GitHub Actions workflow which causes the bug. We use this to reproduce the error. If the workflow is in a private repostory, please provide a minimal example. (No need for backticks here, the pasted code will be correctly formatted.)
render: yaml render: yaml
validations: validations:
required: true required: true
@ -60,5 +60,10 @@ body:
id: logs id: logs
attributes: attributes:
label: Relevant log output label: Relevant log output
description: If applicable, provide relevant log output. No need for backticks here. description: If applicable, provide relevant log output. Please copy and paste the output here, and make sure to remove any sensitive information. (No need for backticks here, the pasted code will be correctly formatted.)
render: shell render: shell
- type: input
id: repository-url
attributes:
label: Repository
description: If applicable, please provide the repository where the bug occurred.

View File

@ -4,5 +4,5 @@ contact_links:
url: https://github.com/stefanzweifel/git-auto-commit-action/discussions/new?category=help url: https://github.com/stefanzweifel/git-auto-commit-action/discussions/new?category=help
about: If you can't get something to work the way you expect, open a question in our discussion forums. about: If you can't get something to work the way you expect, open a question in our discussion forums.
- name: Feature Request - name: Feature Request
url: https://github.com/tailwindlabs/tailwindcss/discussions/new?category=ideas url: https://github.com/stefanzweifel/git-auto-commit-action/discussions/new?category=ideas
about: 'Suggest any ideas you have using our discussion forums.' about: 'Suggest any ideas you have using our discussion forums.'

View File

@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Lint Code Base - name: Lint Code Base
uses: github/super-linter@v5 uses: github/super-linter@v7
env: env:
VALIDATE_ALL_CODEBASE: false VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: false VALIDATE_MARKDOWN: false

View File

@ -234,10 +234,17 @@ storing the token as a secret in your repository and then passing the new token
token: ${{ secrets.PAT }} token: ${{ secrets.PAT }}
``` ```
If you create a personal access token, apply the `repo` and `workflow` scopes. If you create a personal access token (classic), apply the `repo` and `workflow` scopes.
If you create a fine-grained personal access token, apply the `Contents`-permissions.
If you work in an organization and don't want to create a PAT from your personal account, we recommend using a [robot account](https://docs.github.com/en/github/getting-started-with-github/types-of-github-accounts) for the token. If you work in an organization and don't want to create a PAT from your personal account, we recommend using a [robot account](https://docs.github.com/en/github/getting-started-with-github/types-of-github-accounts) for the token.
### Prevent Infinite Loop when using a Personal Access Token
If you're using a Personal Access Token (PAT) to push commits to GitHub repository, the resulting commit or push can trigger other GitHub Actions workflows. This can result in an infinite loop.
If you would like to prevent this, you can add `skip-checks:true` to the commit message. See [Skipping workflow runs](https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs) for details.
### Change to file is not detected ### Change to file is not detected
Does your workflow change a file, but "git-auto-commit" does not detect the change? Check the `.gitignore` that applies to the respective file. You might have accidentally marked the file to be ignored by git. Does your workflow change a file, but "git-auto-commit" does not detect the change? Check the `.gitignore` that applies to the respective file. You might have accidentally marked the file to be ignored by git.
@ -427,13 +434,25 @@ please update your Workflow configuration and usage of [`actions/checkout`](http
Updating the `token` value with a Personal Access Token should fix your issues. Updating the `token` value with a Personal Access Token should fix your issues.
### git-auto-commit fails to push commit that creates or updates files in `.github/workflows/`
The default `GITHUB_TOKEN` issued by GitHub Action does not have permission to make changes to workflow files located in `.github/workflows/`.
To fix this, please create a personal access token (PAT) and pass the token to the `actions/checkout`-step in your workflow. (Similar to [how to push to protected branches](https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#push-to-protected-branches)).
If a PAT does not work for you, you could also create a new GitHub app and use it's token in your workflows. See [this comment in #87](https://github.com/stefanzweifel/git-auto-commit-action/issues/87#issuecomment-1939138661) for details.
See [#322](https://github.com/stefanzweifel/git-auto-commit-action/issues/322) for details and discussions around this topic.
### Push to protected branches ### Push to protected branches
If your repository uses [protected branches](https://help.github.com/en/github/administering-a-repository/configuring-protected-branches) you have to make some changes to your Workflow for the Action to work properly: You need a Personal Access Token and you either have to allow force pushes or the Personal Access Token needs to belong to an Administrator. If your repository uses [protected branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches) you have to make some changes to your Workflow for the Action to work properly: You need a Personal Access Token and you either have to allow force pushes or the Personal Access Token needs to belong to an Administrator.
First, you have to create a new [Personal Access Token (PAT)](https://github.com/settings/tokens/new), First, you have to create a new [Personal Access Token (PAT)](https://github.com/settings/tokens/new),
store the token as a secret in your repository and pass the new token to the [`actions/checkout`](https://github.com/actions/checkout#usage) Action step. store the token as a secret in your repository and pass the new token to the [`actions/checkout`](https://github.com/actions/checkout#usage) Action step.
If you create a personal access token (classic), apply the `repo` and `workflow` scopes.
If you create a fine-grained personal access token, apply the `Contents`-permissions.
```yaml ```yaml
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with: