From f6970dcf7bb78efdf139fbc34d3a02a9906a0d62 Mon Sep 17 00:00:00 2001 From: Ross Nelson Date: Fri, 12 Sep 2025 17:13:05 -0400 Subject: [PATCH 1/2] feat: add trigger-downstream-updates workflow This workflow automatically triggers the generate-ui-pr workflow in temporalio/cloud-ui when changes are pushed to main. - Uses GitHub App authentication for cross-repo access - Passes target SHA and mode to downstream workflow - Includes commit comments for visibility - Can be manually triggered with custom SHA --- .../workflows/trigger-downstream-updates.yml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/trigger-downstream-updates.yml diff --git a/.github/workflows/trigger-downstream-updates.yml b/.github/workflows/trigger-downstream-updates.yml new file mode 100644 index 0000000000..ab403649f8 --- /dev/null +++ b/.github/workflows/trigger-downstream-updates.yml @@ -0,0 +1,66 @@ +name: Trigger Downstream Updates + +on: + push: + branches: + - main + # paths: + # Only trigger when actual code changes are made + # - 'src/**' + # - 'package.json' + # - 'pnpm-lock.yaml' + workflow_dispatch: + inputs: + target-sha: + description: 'Specific SHA to use (defaults to current HEAD)' + required: false + default: '' + +jobs: + trigger-updates: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Generate token for cross-repo access + id: generate_token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.TEMPORAL_CICD_APP_ID }} + private-key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }} + owner: temporalio + repositories: cloud-ui,ui,pack-dependency-actions + + - name: Prepare workflow inputs + id: prepare + run: | + # Determine SHA to use + if [ -n "${{ github.event.inputs.target-sha }}" ]; then + SHA="${{ github.event.inputs.target-sha }}" + else + SHA="${{ github.sha }}" + fi + + # Create workflow inputs JSON (compact format for GITHUB_OUTPUT) + INPUTS=$(jq -nc \ + --arg sha "$SHA" \ + --arg mode "release" \ + '{"target-sha": $sha, "mode": $mode}') + + echo "inputs=$INPUTS" >> $GITHUB_OUTPUT + echo "sha=$SHA" >> $GITHUB_OUTPUT + echo "sha_short=$(echo $SHA | cut -c1-8)" >> $GITHUB_OUTPUT + echo "Using SHA: $(echo $SHA | cut -c1-8)" + + - name: Trigger cloud-ui update + uses: temporalio/pack-dependency-actions/dispatch-workflow@main + with: + token: ${{ steps.generate_token.outputs.token }} + repository: temporalio/cloud-ui + workflow: generate-ui-pr.yml + ref: main + inputs: ${{ steps.prepare.outputs.inputs }} + add-commit-comment: true + commit-comment-template: '🚀 Triggered `{workflow}` in {repository} on {ref} with SHA `${{ steps.prepare.outputs.sha_short }}`' + log-title: Downstream Update Triggered \ No newline at end of file From f17e2455abe50a27ca20040adbb5c5c8fd525ede Mon Sep 17 00:00:00 2001 From: Ross Nelson Date: Fri, 12 Sep 2025 17:26:57 -0400 Subject: [PATCH 2/2] lint --- .github/workflows/trigger-downstream-updates.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/trigger-downstream-updates.yml b/.github/workflows/trigger-downstream-updates.yml index ab403649f8..34c2d2ff80 100644 --- a/.github/workflows/trigger-downstream-updates.yml +++ b/.github/workflows/trigger-downstream-updates.yml @@ -41,13 +41,13 @@ jobs: else SHA="${{ github.sha }}" fi - + # Create workflow inputs JSON (compact format for GITHUB_OUTPUT) INPUTS=$(jq -nc \ --arg sha "$SHA" \ --arg mode "release" \ '{"target-sha": $sha, "mode": $mode}') - + echo "inputs=$INPUTS" >> $GITHUB_OUTPUT echo "sha=$SHA" >> $GITHUB_OUTPUT echo "sha_short=$(echo $SHA | cut -c1-8)" >> $GITHUB_OUTPUT @@ -63,4 +63,4 @@ jobs: inputs: ${{ steps.prepare.outputs.inputs }} add-commit-comment: true commit-comment-template: '🚀 Triggered `{workflow}` in {repository} on {ref} with SHA `${{ steps.prepare.outputs.sha_short }}`' - log-title: Downstream Update Triggered \ No newline at end of file + log-title: Downstream Update Triggered