From 6f098ce45d0e853b2ad7559fc149fc0a362f7ae2 Mon Sep 17 00:00:00 2001 From: Pranav Patil Date: Tue, 4 Aug 2026 11:11:13 +0500 Subject: [PATCH 1/4] fix: dispatch publish workflow from helm-charts-release --- .github/workflows/helm-charts-release.yaml | 14 ++++++++++++++ .github/workflows/publish.yaml | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm-charts-release.yaml b/.github/workflows/helm-charts-release.yaml index 6e6d15e..046ee7f 100644 --- a/.github/workflows/helm-charts-release.yaml +++ b/.github/workflows/helm-charts-release.yaml @@ -9,6 +9,7 @@ on: permissions: contents: write + actions: write run-name: ${{ github.repository }} Release ${{ inputs.release }} @@ -35,3 +36,16 @@ jobs: version: ${{ inputs.release }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish-artifacts: + needs: [github-release] + runs-on: ubuntu-latest + steps: + - name: Trigger publish workflow + run: | + gh workflow run publish.yaml \ + --repo ${{ github.repository }} \ + --ref main \ + --field tag=${{ inputs.release }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 9f4164d..79a5fd2 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -5,8 +5,14 @@ on: push: branches: - 'main' + workflow_dispatch: + inputs: + tag: + description: "Release tag to publish (e.g. v0.35.2)" + required: true + type: string env: - TAG_NAME: ${{ github.event.release.tag_name || (github.ref == 'refs/heads/main' && 'main') }} + TAG_NAME: ${{ github.event.inputs.tag || github.event.release.tag_name || (github.ref == 'refs/heads/main' && 'main') }} jobs: publish-docker: From de8c3a97dc182a889e05dc2107e7b8a744a1fa2a Mon Sep 17 00:00:00 2001 From: Pranav Patil Date: Tue, 4 Aug 2026 16:56:43 +0500 Subject: [PATCH 2/4] fix: sequencing of the workflow --- .github/workflows/helm-charts-release.yaml | 47 ++++++++++++++++------ .github/workflows/publish.yaml | 2 + 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/.github/workflows/helm-charts-release.yaml b/.github/workflows/helm-charts-release.yaml index 046ee7f..113d072 100644 --- a/.github/workflows/helm-charts-release.yaml +++ b/.github/workflows/helm-charts-release.yaml @@ -18,7 +18,41 @@ concurrency: cancel-in-progress: true jobs: + publish-artifacts: + runs-on: ubuntu-latest + steps: + - name: Trigger and wait for publish workflow + run: | + DISPATCH_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ) + + gh workflow run publish.yaml \ + --repo ${{ github.repository }} \ + --ref main \ + --field tag=${{ inputs.release }} + + echo "Waiting for the dispatched run to appear..." + for i in $(seq 1 30); do + RUN_ID=$(gh run list \ + --repo ${{ github.repository }} \ + --workflow publish.yaml \ + --json databaseId,createdAt,event \ + --jq "[.[] | select(.event == \"workflow_dispatch\" and .createdAt >= \"$DISPATCH_TIME\")] | sort_by(.createdAt) | .[0].databaseId") + [ -n "$RUN_ID" ] && [ "$RUN_ID" != "null" ] && break + sleep 10 + done + + if [ -z "$RUN_ID" ] || [ "$RUN_ID" = "null" ]; then + echo "Timed out waiting for publish.yaml run to appear" + exit 1 + fi + + echo "Watching run $RUN_ID" + gh run watch "$RUN_ID" --repo ${{ github.repository }} --exit-status + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + github-release: + needs: [publish-artifacts] runs-on: ubuntu-latest steps: - name: Checkout @@ -36,16 +70,3 @@ jobs: version: ${{ inputs.release }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - publish-artifacts: - needs: [github-release] - runs-on: ubuntu-latest - steps: - - name: Trigger publish workflow - run: | - gh workflow run publish.yaml \ - --repo ${{ github.repository }} \ - --ref main \ - --field tag=${{ inputs.release }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 79a5fd2..8bc28ae 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -42,6 +42,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + ref: ${{ env.TAG_NAME }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx From c64a103245246b0075552bc5cfdf1d03599ec100 Mon Sep 17 00:00:00 2001 From: Pranav Patil Date: Tue, 4 Aug 2026 17:29:46 +0500 Subject: [PATCH 3/4] fix: use workflow_call --- .github/workflows/helm-charts-release.yaml | 36 +++------------------- .github/workflows/publish.yaml | 10 ++++-- 2 files changed, 11 insertions(+), 35 deletions(-) diff --git a/.github/workflows/helm-charts-release.yaml b/.github/workflows/helm-charts-release.yaml index 113d072..75ac7e8 100644 --- a/.github/workflows/helm-charts-release.yaml +++ b/.github/workflows/helm-charts-release.yaml @@ -9,7 +9,6 @@ on: permissions: contents: write - actions: write run-name: ${{ github.repository }} Release ${{ inputs.release }} @@ -19,37 +18,10 @@ concurrency: jobs: publish-artifacts: - runs-on: ubuntu-latest - steps: - - name: Trigger and wait for publish workflow - run: | - DISPATCH_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ) - - gh workflow run publish.yaml \ - --repo ${{ github.repository }} \ - --ref main \ - --field tag=${{ inputs.release }} - - echo "Waiting for the dispatched run to appear..." - for i in $(seq 1 30); do - RUN_ID=$(gh run list \ - --repo ${{ github.repository }} \ - --workflow publish.yaml \ - --json databaseId,createdAt,event \ - --jq "[.[] | select(.event == \"workflow_dispatch\" and .createdAt >= \"$DISPATCH_TIME\")] | sort_by(.createdAt) | .[0].databaseId") - [ -n "$RUN_ID" ] && [ "$RUN_ID" != "null" ] && break - sleep 10 - done - - if [ -z "$RUN_ID" ] || [ "$RUN_ID" = "null" ]; then - echo "Timed out waiting for publish.yaml run to appear" - exit 1 - fi - - echo "Watching run $RUN_ID" - gh run watch "$RUN_ID" --repo ${{ github.repository }} --exit-status - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: ./.github/workflows/publish.yaml + with: + tag: ${{ inputs.release }} + secrets: inherit github-release: needs: [publish-artifacts] diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 8bc28ae..33c82f8 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -11,8 +11,14 @@ on: description: "Release tag to publish (e.g. v0.35.2)" required: true type: string + workflow_call: + inputs: + tag: + description: "Release tag to publish (e.g. v0.35.2)" + required: true + type: string env: - TAG_NAME: ${{ github.event.inputs.tag || github.event.release.tag_name || (github.ref == 'refs/heads/main' && 'main') }} + TAG_NAME: ${{ inputs.tag || github.event.release.tag_name || (github.ref == 'refs/heads/main' && 'main') }} jobs: publish-docker: @@ -42,8 +48,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - ref: ${{ env.TAG_NAME }} - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx From 8ed49db0213b68617085d250252959926cc8b478 Mon Sep 17 00:00:00 2001 From: Pranav Patil Date: Tue, 4 Aug 2026 17:35:47 +0500 Subject: [PATCH 4/4] fix: permission --- .github/workflows/helm-charts-release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/helm-charts-release.yaml b/.github/workflows/helm-charts-release.yaml index 75ac7e8..efd876a 100644 --- a/.github/workflows/helm-charts-release.yaml +++ b/.github/workflows/helm-charts-release.yaml @@ -9,6 +9,7 @@ on: permissions: contents: write + packages: write run-name: ${{ github.repository }} Release ${{ inputs.release }}