Skip to content

Commit cd1b390

Browse files
fix: Use workflow_dispatch instead of workflow_call for OIDC compatibility (#912)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 3869ac4 commit cd1b390

File tree

2 files changed

+34
-10
lines changed

2 files changed

+34
-10
lines changed

.github/workflows/prerelease-command.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,23 @@ jobs:
6868
prerelease-version: ${{ steps.version.outputs.version }}
6969

7070
build-and-publish:
71-
name: Call Publish Workflow
71+
name: Trigger Publish Workflow
7272
needs: [resolve-pr]
73-
uses: ./.github/workflows/pypi_publish.yml
74-
with:
75-
# Use refs/pull/<PR>/head instead of raw SHA for fork compatibility
76-
git_ref: refs/pull/${{ github.event.inputs.pr }}/head
77-
version_override: ${{ needs.resolve-pr.outputs.prerelease-version }}
78-
publish: true
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Trigger pypi_publish workflow
76+
id: dispatch
77+
uses: the-actions-org/workflow-dispatch@v4
78+
with:
79+
workflow: pypi_publish.yml
80+
token: ${{ secrets.GITHUB_CI_WORKFLOW_TRIGGER_PAT }}
81+
ref: main # Run from main so OIDC attestation matches trusted publisher
82+
inputs: '{"git_ref": "refs/pull/${{ github.event.inputs.pr }}/head", "version_override": "${{ needs.resolve-pr.outputs.prerelease-version }}", "publish": "true"}'
83+
wait-for-completion: true
84+
wait-for-completion-timeout: 30m
85+
outputs:
86+
workflow-conclusion: ${{ steps.dispatch.outputs.workflow-conclusion }}
87+
workflow-url: ${{ steps.dispatch.outputs.workflow-url }}
7988

8089
post-result-comment:
8190
name: Write Status to PR
@@ -94,6 +103,7 @@ jobs:
94103
> **Prerelease Published to PyPI**
95104
>
96105
> Version: `${{ needs.resolve-pr.outputs.prerelease-version }}`
106+
> [View publish workflow](${{ needs.build-and-publish.outputs.workflow-url }})
97107
>
98108
> Install with:
99109
> ```bash
@@ -110,7 +120,7 @@ jobs:
110120
> **Prerelease Build/Publish Failed**
111121
>
112122
> The prerelease encountered an error.
113-
> [Check job output](${{ needs.resolve-pr.outputs.job-run-url }}) for details.
123+
> [Check publish workflow output](${{ needs.build-and-publish.outputs.workflow-url }}) for details.
114124
>
115125
> You can still install directly from this PR branch:
116126
> ```bash

.github/workflows/pypi_publish.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ on:
44
push:
55

66
workflow_dispatch:
7+
inputs:
8+
git_ref:
9+
description: 'Git ref (SHA or branch) to checkout and build'
10+
required: false
11+
type: string
12+
version_override:
13+
description: 'Version to use (overrides dynamic versioning)'
14+
required: false
15+
type: string
16+
publish:
17+
description: 'Whether to publish to PyPI (true/false)'
18+
required: false
19+
type: string
20+
default: 'false'
721

822
workflow_call:
923
inputs:
@@ -56,8 +70,8 @@ jobs:
5670
environment:
5771
name: PyPi
5872
url: https://pypi.org/p/airbyte
59-
# Publish when: (1) triggered by a tag push, OR (2) called with publish=true
60-
if: startsWith(github.ref, 'refs/tags/') || inputs.publish == true
73+
# Publish when: (1) triggered by a tag push, OR (2) called with publish=true (handles both boolean and string)
74+
if: startsWith(github.ref, 'refs/tags/') || inputs.publish == true || inputs.publish == 'true'
6175
steps:
6276
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
6377
with:

0 commit comments

Comments
 (0)