Skip to content

create-root-readme

create-root-readme #28

name: create-root-readme
on:
workflow_run:
workflows: [ "generate-terraform-docs" ] # Runs after completion of generate-terraform-docs workflow
types:
- completed
permissions:
contents: write
jobs:
create-root-readme:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Token generator
uses: githubofkrishnadhas/github-access-using-githubapp@v2
id: token-generation
with:
github_app_id: ${{ secrets.TOKEN_GENERATOR_APPID }}
github_app_private_key: ${{ secrets.TOKEN_GENERATOR_PRIVATE_KEY }}
- name: Ensure tree command is installed
run: sudo apt update && sudo apt-get install -y tree
- name: Run the tree generation script
run: |
bash create-readme.sh
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ steps.token-generation.outputs.token }}
run: |
git config user.name 'github-actions-bot'
git config user.email 'actions@github.com'
git add .
git commit -m "Update documentation"
git push