Skip to content

update-inspektor-gadget-version #356

update-inspektor-gadget-version

update-inspektor-gadget-version #356

name: "update-inspektor-gadget-version"
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:
contents: read
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@ee0669bd1cc54295c223e0bb666b733df41de1c5
- 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 config.yaml)"]; then
python3 tools/add-version.py config.yaml $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@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'docs: Add documentation for ${{ steps.bump_inspektor_gadget.outputs.version }}'
branch: 'auto_bump_inspektor_gadget_version_${{ steps.bump_inspektor_gadget.outputs.version }}'
base: main
delete-branch: true
title: 'docs: Add documentation 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 the documentation website needs to be updated.
This PR was automatically generated by a Python script and a CI cron job:
* [update-inspektor-gadget-release.yaml](https://github.com/inspektor-gadget/website/blob/main/.github/workflows/update-inspektor-gadget-release.yaml)
* [add-version.py](https://github.com/inspektor-gadget/website/blob/main/tools/add-version.py)
This PR will not be automatically merged. Please review, edit and merge as appropriate.
After merging, the following will be updated:
https://inspektor-gadget.io/docs
Best regards.