rename repo #80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Helm Readme Generator' | |
on: | |
pull_request_target: | |
branches: | |
- main | |
paths: | |
- 'helm/*/values.yaml' | |
permissions: | |
contents: write | |
jobs: | |
update-readme: | |
name: Update README.md | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Install readme-generator-for-helm | |
run: npm install -g @bitnami/[email protected] | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{github.event.pull_request.head.ref}} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Execute readme-generator-for-helm | |
working-directory: helm/ingress-controller | |
run: | | |
# Using the Github API to detect the files changed as git merge-base stops working when the branch is behind | |
# and jitterbit/get-changed-files does not support pull_request_target | |
URL="https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | |
files_changed_data=$(curl -s --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X GET -G "$URL") | |
files_changed="$(echo $files_changed_data | jq -r '.[] | .filename')" | |
readme-generator --values "values.yaml" --readme "README.md" --schema "/tmp/schema.json" | |
- name: Push changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update README.md with readme-generator-for-helm |