Description
What problem are you facing?
My use case is when I use a separate git action to manage git changes, like pushes, creating a new pull request, etc. When running terraform-docs/gh-actions
, it will always configure git and stage the changes even when I don't use push or fail. Sometimes those git changes that I didn't need to happen, since I didn't want a push or a faill on diff, change the git setup for the workflow and are incompatible with the next steps I would like to use, like not taking into account a generated Github token, checking out the branch.
For example, for git setup with token, user, and email configuration, I could use the inputs of actions/checkout. Depending on whether my use case is a Github organization, etc, the git setup can change, and it wouldn't be feasible to cover all the git setup scenarios in git_setup
.
gh-actions/src/docker-entrypoint.sh
Lines 56 to 65 in d8f1a22
For committing changes, there are some actions, like stefanzweifel/git-auto-commit-action, with logic for different commit use cases.
gh-actions/src/docker-entrypoint.sh
Lines 82 to 100 in d8f1a22
For failing on diff, a small bash script like git add -A && git diff --exit-code HEAD
can be used and there are also actions like nickcharlton/diff-check that cover more use cases.
gh-actions/src/docker-entrypoint.sh
Lines 78 to 80 in d8f1a22
This use case of pull requests is not covered today in terraform-docs/gh-actions
but just as another example. For handling new or existing pull requests, the action peter-evans/create-pull-request can be used.
How could terraform-docs help solve your problem?
Essentially, my request is to reduce the maintenance and increase stability of this action by narrowing its scope to terraform-docs
, which it does very well today. So I think deprecating the git features, like setup, staging, and diff, could help multiple people use or contribute to this project.
- Solve my use case by using other actions for git changes.
- Remove confusion for other users who have new git use cases.
- Reduce work for this action's mantainers who do not have to support git features and can focus more on
terraform-docs
use cases.
For example, it could potentially solve the following issues I found related to git features:
- Allow fail-on-diff regardless of git-push #88
- insufficient permission for adding an object to repository database .git/objects error: Error building trees #90
- Action fails to run with Github Enterprise using a self-signed certificate #122
- gitconfig not found #147
Alternatives Explored
I couldn't make it work with this action after multiple attempts trying to disable or reset git staging index and configuration, so the next workflow steps can find the git configuration as it was before running terraform-docs/gh-actions
, except for the changes in the working tree. So I ended up installing the release with
- name: Install terraform-docs
uses: jaxxstorm/action-install-gh-release@4304621e8c48d66093a8a214af5d5b5bc3b3d943 # v2.0.0
with:
repo: terraform-docs/terraform-docs
tag: v0.19.0
- name: Generate documentation files
run: |-
terraform-docs .