Update Helm Repository Index #33
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 Helm Repository Index" | |
on: | |
workflow_dispatch: | |
schedule: | |
# Daily at 4 UTC. Usually Inspektor Gadget is released on Monday, but there are exceptions, like bug fix releases. | |
- cron: "0 4 * * *" | |
permissions: read-all | |
jobs: | |
bump-inspektor-gadget-version: | |
runs-on: ubuntu-latest | |
permissions: | |
# This is needed by below action used to open PR: | |
# https://github.com/peter-evans/create-pull-request#action-inputs | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Bump inspektor-gadget version | |
id: bump_inspektor_gadget | |
run: | | |
inspektor_gadget_version=$(curl --silent https://api.github.com/repos/inspektor-gadget/inspektor-gadget/releases/latest | jq .tag_name | tr -d '"') | |
if [ -z "$(grep $inspektor_gadget_version index.yaml)" ]; then | |
curl -LO https://github.com/inspektor-gadget/inspektor-gadget/releases/download/${inspektor_gadget_version}/gadget-${inspektor_gadget_version#v}.tgz | |
helm repo index --merge index.yaml --url https://github.com/inspektor-gadget/inspektor-gadget/releases/download/${inspektor_gadget_version} . | |
fi | |
echo "version=${inspektor_gadget_version}" >> $GITHUB_OUTPUT | |
# The following is to support multiline with GITHUB_OUTPUT, see: | |
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings | |
echo "changes<<EOF" >> $GITHUB_OUTPUT | |
echo "$(git status --porcelain)" >> $GITHUB_OUTPUT | |
echo "EOF" >> $GITHUB_OUTPUT | |
- name: Create PR | |
if: ${{ steps.bump_inspektor_gadget.outputs.changes != '' }} | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: 'docs: Bump helm repository index for ${{ steps.bump_inspektor_gadget.outputs.version }}' | |
branch: auto_bump_inspektor_gadget_version | |
base: main | |
delete-branch: true | |
title: 'docs: Bump helm repository index for ${{ steps.bump_inspektor_gadget.outputs.version }}' | |
body: | | |
Hi. | |
We released a new version of Inspektor Gadget [${{ steps.bump_inspektor_gadget.outputs.version }}](https://github.com/inspektor-gadget/inspektor-gadget/releases/tag/${{ steps.bump_inspektor_gadget.outputs.version }}), so helm index needs to be updated. | |
This PR was automatically generated by a CI cron job: | |
* [update-helm-index.yml](https://github.com/inspektor-gadget/charts/blob/main/.github/workflows/update-helm-index.yml) | |
This PR will not be automatically merged. Please review, edit and merge as appropriate. | |
After merging, the following will be updated: | |
* [GitHub Page for Charts](https://inspektor-gadget.github.io/charts/index.yaml) | |
* [Artifact Hub](https://artifacthub.io/packages/helm/gadget/gadget) | |
Best regards. |