From 6905cc0168d91654f7de9a729ea58709cfdf710d Mon Sep 17 00:00:00 2001 From: Andrea Lamparelli Date: Tue, 7 May 2024 13:59:34 +0200 Subject: [PATCH] Automate Kiota version upgrade --- .github/workflows/update-kiota.yaml | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/update-kiota.yaml diff --git a/.github/workflows/update-kiota.yaml b/.github/workflows/update-kiota.yaml new file mode 100644 index 0000000..8f99548 --- /dev/null +++ b/.github/workflows/update-kiota.yaml @@ -0,0 +1,42 @@ +# This workflow will update the Kiota generator version in the Makefile and it will +# re-generate the client opening a pull request with those changes. +name: Update Kiota generator version + +on: + workflow_dispatch: + inputs: + version: + description: New Kiota version + required: true + branch: + description: Target branch to open the PR against + required: false + default: main +jobs: + update-kiota: + name: update-kiota/${{ github.event.inputs.version }}/${{ github.event.inputs.branch }} + runs-on: ubuntu-latest + env: + PYTHON_VERSION: "3.10" + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.branch }} + persist-credentials: false + - name: Set up Python ${{ env.PYTHON_VERSION }} + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Update Kiota version + run: sed -i 's/KIOTA_VERSION ?= ".*"/KIOTA_VERSION ?= "v${{ github.event.inputs.version }}"/g' Makefile + - name: Create Pull Request + uses: gr2m/create-or-update-pull-request-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + title: Update Kiota version to ${{ github.event.inputs.version }} + body: > + Updating Kiota version to ${{ github.event.inputs.version }}. + Verify there are no breaking changes. + branch: update-kiota-version-${{ github.event.inputs.branch }}-${{ github.event.inputs.version }} + commit-message: Update kiota version to ${{ github.event.inputs.version }}