This is an action that uses the Github Git Database API to commit changes to a branch. This allows for easier committing against protected branches, and avoids a lot of potential edge cases that can occur when using git
directly.
Name | Default/Required | Description |
---|---|---|
message |
None, required | Message for the commit |
glob-patterns |
None, required | List of minimatch glob patterns. Matching files with changes will be committed. See the examples for how to specify multiple patterns. |
token |
Default Github Actions Token | Github token to authenticate as |
branch |
Default branch for the repo | Branch to commit the changes to |
append-run-info |
true |
Whether to append information about the workflow to the commit |
retries |
10 | Number of times to retry the commit (which may fail due to non-fastfoward upates) |
Name | Description |
---|---|
sha |
SHA of the resulting commit. Will be empty string if there were no changes to commit |
uses: quizlet/commit-changes@[ref]
with:
message: Automated commit
glob-patterns: README.md
Useful when:
- You want to commit as a different actor than the default Github Actions token
- You want to use an admin user to commit to a protected branch
uses: quizlet/commit-changes@[ref]
with:
token: ${{ secret.ADMIN_TOKEN }}
message: Automated commit
glob-patterns: README.md
uses: quizlet/commit-changes@[ref]
with:
message: Automated commit
glob-patterns: README.md, *.json
uses: quizlet/commit-changes@[ref]
with:
message: Automated commit
glob-patterns: |
README.md
# Comments are allowed
*.json
- Tech @ Quizlet Blog Post: Explains background for the project
- Minimatch cheat sheat
- Minimatch glob tester
- globby-cli: Useful for testing globs locally (i.e.
npx globby-cli --gitignore [glob]
)
Feel free to check out our Contributor's Guide.
The code and documentation in this project are released under the MIT License.