From b0f99ffc808c0408345a4f0acdce13a289db790d Mon Sep 17 00:00:00 2001 From: ian-flores Date: Mon, 2 Feb 2026 09:51:19 -0800 Subject: [PATCH 1/2] feat: dispatch version update to PTD on release Adds a notify-ptd job to the release workflow that sends a repository_dispatch event to posit-dev/ptd after a successful release. This triggers PTD to automatically create a PR updating the default team-operator chart version. Requires PTD_REPO_TOKEN secret with repo scope for posit-dev/ptd. --- .github/workflows/release.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e964623a..bc1c06cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,3 +114,33 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release upload ${{ steps.get-tag.outputs.tag }} team-operator-${{ steps.get-tag.outputs.tag }}.tgz --clobber + + notify-ptd: + needs: package-helm + runs-on: ubuntu-latest + if: ${{ needs.package-helm.result == 'success' }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: main + + - name: Get latest tag + id: get-tag + run: | + git fetch --tags + TAG=$(git tag --sort=-version:refname | head -1 || echo "") + echo "tag=$TAG" >> $GITHUB_OUTPUT + + - name: Dispatch version update to PTD + if: steps.get-tag.outputs.tag != '' + env: + PTD_REPO_TOKEN: ${{ secrets.PTD_REPO_TOKEN }} + run: | + curl -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $PTD_REPO_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/posit-dev/ptd/dispatches \ + -d '{"event_type":"team-operator-release","client_payload":{"version":"${{ steps.get-tag.outputs.tag }}"}}' From 338213d7f0717585ce926360b6ae46b8abf2b73b Mon Sep 17 00:00:00 2001 From: ian-flores Date: Mon, 2 Feb 2026 17:14:53 -0800 Subject: [PATCH 2/2] refactor: use gh CLI instead of curl for PTD dispatch Address @statik's review feedback by replacing the curl-based repository_dispatch with gh workflow run. This is cleaner and consistent with other gh commands in the workflow. --- .github/workflows/release.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc1c06cb..ede4106c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -136,11 +136,8 @@ jobs: - name: Dispatch version update to PTD if: steps.get-tag.outputs.tag != '' env: - PTD_REPO_TOKEN: ${{ secrets.PTD_REPO_TOKEN }} + GH_TOKEN: ${{ secrets.PTD_REPO_TOKEN }} run: | - curl -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer $PTD_REPO_TOKEN" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/posit-dev/ptd/dispatches \ - -d '{"event_type":"team-operator-release","client_payload":{"version":"${{ steps.get-tag.outputs.tag }}"}}' + gh workflow run update-team-operator-version.yml \ + --repo posit-dev/ptd \ + --field version=${{ steps.get-tag.outputs.tag }}