Skip to content

Update console to latest release 1.19.0 #88

Update console to latest release 1.19.0

Update console to latest release 1.19.0 #88

name: 'Update README Metadata'
on:
pull_request:
paths: ['charts/**']
types:
- opened
- edited
- reopened
- synchronize
permissions:
contents: read
jobs:
update-readme-metadata:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: read
steps:
- name: Install readme-generator-for-helm
run: npm install -g @bitnami/[email protected]
- uses: actions/checkout@v3
name: Checkout Conduktor Charts
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Execute readme-generator-for-helm
env:
GH_TOKEN: ${{ github.token }}
TEMP_FILE: "${{runner.temp}}/pr-${{github.event.number}}.diff"
run: |
export PR_ID=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
gh pr diff ${PR_ID} > $TEMP_FILE
files_changed="$(sed -nr 's/[\-\+]{3} [ab]\/(.*)/\1/p' $TEMP_FILE | sort | uniq)"
# Adding || true to avoid "Process exited with code 1" errors
charts_dirs_changed="$(echo "$files_changed" | xargs dirname | grep -o "charts/[^/]*" | sort | uniq || true)"
for chart in ${charts_dirs_changed}; do
echo "Updating README.md for ${chart}"
readme-generator --values "${chart}/values.yaml" --readme "${chart}/README.md" --schema "/tmp/schema.json"
done
- name: Setup GPG
id: gpg
uses: crazy-max/[email protected]
with:
gpg_private_key: ${{ secrets.CONDUKTOR_BOT_GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Push changes
run: |
if git status -s | grep -E 'charts/.*/README.md'; then
git config user.name "${{ steps.gpg.outputs.name }}"
git config user.email "${{ steps.gpg.outputs.email }}"
git add . && git commit -S -am "chore(chart): Update README.md with readme-generator-for-helm" --signoff && git push
fi