charts/timesketch Lock tag by release version, simplify ingress for non GKE setups, remove roll and config override, allow multiple instances to run, README updates #126
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: 'Update README metadata' | |
on: | |
pull_request_target: | |
branches: | |
- main | |
paths: | |
- 'charts/*/values.yaml' | |
# Remove all permissions by default | |
permissions: {} | |
jobs: | |
update-readme-metadata: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Install readme-generator-for-helm | |
run: npm install -g @bitnami/readme-generator-for-helm | |
- name: Checkout osdfir-infrastructure/charts | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
with: | |
path: charts | |
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 | |
env: | |
DIFF_URL: "${{github.event.pull_request.diff_url}}" | |
TEMP_FILE: "${{runner.temp}}/pr-${{github.event.number}}.diff" | |
run: | | |
exit_code=0 | |
# This request doesn't consume API calls. | |
curl -Lkso $TEMP_FILE $DIFF_URL | |
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 "charts/${chart}/values.yaml" --readme "charts/${chart}/README.md" | |
done | |
- name: Push changes | |
run: | | |
# Push all the changes | |
cd charts | |
if git status -s | grep charts; then | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
git add . && git commit -am "Update README.md with readme-generator-for-helm" --signoff && git push | |
fi |