GitHub Action
Give your infrastructure repositories some flair by injecting Terrafetch statistics right into your documentation.
- Add report markers somewhere in your
README.md
(or any file you point the action at):
<!-- TERRAFETCH:START -->
<!-- TERRAFETCH:END -->
- Make sure your repo permissions allow the default
GITHUB_TOKEN
to contents: write
so the bot can push the updated file.
Example Workflow
name: Terrafetch
on:
schedule:
- cron: "0 3 * * *" # every night at 03:00
workflow_dispatch: # manual trigger when you need it
permissions:
contents: write # let the action push changes
jobs:
terrafetch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate README stats with Terrafetch
uses: RoseSecurity/terrafetch@v0.2.0
with:
terraform_directory: infra
output_file: README.md # file with the START/END markers
terrafetch_version: 0.2.0 # "latest" also works
What's Changed
- feat: create a github action for terrafetch by @RoseSecurity in #6
- Update GitHub action docs by @RoseSecurity in #7
Full Changelog: v0.2.0...v0.3.0