The clowdhaus/terraform-composite-actions/commit
action will commit any changes back to your git-branch
. When used in conjunction with clowdhaus/terraform-composite-actions/pre-commit
, this action will ensure that pull-requests are well formatted and the automatically generated documentation is updated.
A GitHub personal access token is required in order for the action to be able to successfully commit and push any changes back to the specified branch.
When using this action from a forked copy, it will only succeed if either of two conditions are met:
- The user who has forked the project must create a GitHub personal access token with the defined permissions and store it in their forked repository under the same name as the upstream secret (defined in the workflow file)
- The entity that presides over the source repository extends access to the secret (you should be mindful of what this means - extending secret access to forked repositories means those forks could potentially retrieve those secret values) via https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/
jobs:
commit:
name: Commit changes
runs-on: ubuntu-latest
steps:
- name: Commit changes
uses: clowdhaus/terraform-composite-actions/commit@main
with:
git-branch: ${{ github.event.pull_request.head.ref }}
github-repository: ${{github.event.pull_request.head.repo.full_name}}
github-token: ${{ secrets.YOUR_GITHUB_PAT }}