-
Notifications
You must be signed in to change notification settings - Fork 39
feat: add /prerelease slash command to trigger publish workflow #839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Aaron ("AJ") Steers (aaronsteers)
merged 7 commits into
main
from
devin/1762681962-add-prerelease-slash-command
Nov 9, 2025
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4997c93
feat: add /prerelease slash command to trigger publish workflow
devin-ai-integration[bot] 563b6e8
docs: update guidance and PR welcome messages to advertise /prereleas…
devin-ai-integration[bot] cdd2eec
fix: address bot feedback on prerelease workflow
devin-ai-integration[bot] 60b0015
refactor: use marketplace action for workflow dispatch
devin-ai-integration[bot] 44118d6
Apply suggestion from @aaronsteers
aaronsteers b92a899
Apply suggestion from @aaronsteers
aaronsteers 1ae8562
Apply suggestion from @aaronsteers
aaronsteers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| name: On-Demand Prerelease | ||
|
|
||
| # Minimal permissions for security (addresses GitHub Advanced Security feedback) | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| issues: write | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| pr: | ||
| description: "PR Number" | ||
| type: string | ||
| required: false | ||
| comment-id: | ||
| description: "Comment ID (Optional)" | ||
| type: string | ||
| required: false | ||
|
|
||
| jobs: | ||
| prerelease-on-demand: | ||
| name: Trigger Prerelease Publish | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Authenticate as GitHub App | ||
| uses: actions/create-github-app-token@v2 | ||
| id: get-app-token | ||
| with: | ||
| owner: "airbytehq" | ||
| repositories: "airbyte-python-cdk" | ||
| app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }} | ||
| private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }} | ||
|
|
||
| - name: Create URL to the run output | ||
| id: vars | ||
| run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Check that PR number is provided | ||
| if: github.event.inputs.pr == '' | ||
| run: | | ||
| echo "Error: /prerelease command must be invoked on a pull request, not an issue." | ||
| exit 1 | ||
|
|
||
| - name: Get PR info | ||
| id: pr-info | ||
| run: | | ||
| PR_JSON=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.inputs.pr }}) | ||
| HEAD_REF=$(echo "$PR_JSON" | jq -r .head.ref) | ||
| HEAD_REPO=$(echo "$PR_JSON" | jq -r .head.repo.full_name) | ||
| echo "head-ref=${HEAD_REF}" >> $GITHUB_OUTPUT | ||
| echo "head-repo=${HEAD_REPO}" >> $GITHUB_OUTPUT | ||
| echo "PR branch: ${HEAD_REF} from ${HEAD_REPO}" | ||
| env: | ||
| GH_TOKEN: ${{ steps.get-app-token.outputs.token }} | ||
|
|
||
| - name: Check that PR is from this repository (not a fork) | ||
| if: steps.pr-info.outputs.head-repo != github.repository | ||
| run: | | ||
| echo "Error: /prerelease only works for branches in this repository, not forks." | ||
| echo "PR is from: ${{ steps.pr-info.outputs.head-repo }}" | ||
| echo "Expected: ${{ github.repository }}" | ||
| exit 1 | ||
|
|
||
| - name: Append comment with job run link | ||
| if: github.event.inputs.comment-id | ||
| id: first-comment-action | ||
| uses: peter-evans/create-or-update-comment@v4 | ||
| with: | ||
| comment-id: ${{ github.event.inputs.comment-id }} | ||
| issue-number: ${{ github.event.inputs.pr }} | ||
| body: | | ||
| > **Prerelease Job Info** | ||
| > | ||
| > This job triggers the publish workflow with default arguments to create a prerelease. | ||
| > | ||
| > Prerelease job started... [Check job output.][1] | ||
|
|
||
| [1]: ${{ steps.vars.outputs.run-url }} | ||
|
|
||
| - name: Trigger publish workflow | ||
| id: trigger-publish | ||
| uses: the-actions-org/workflow-dispatch@v4 | ||
| with: | ||
| workflow: publish.yml | ||
| token: ${{ steps.get-app-token.outputs.token }} | ||
| ref: ${{ steps.pr-info.outputs.head-ref }} | ||
| wait-for-completion: true | ||
| display-workflow-run-url: false | ||
| inputs: >- | ||
| { | ||
| "version": "", | ||
| "publish_to_pypi": "true", | ||
| "publish_to_dockerhub": "true", | ||
| "publish_manifest_server": "false", | ||
| "update_connector_builder": "false" | ||
| } | ||
|
|
||
| - name: Append success comment | ||
| if: github.event.inputs.comment-id | ||
| uses: peter-evans/create-or-update-comment@v4 | ||
| with: | ||
| comment-id: ${{ steps.first-comment-action.outputs.comment-id }} | ||
| reactions: hooray | ||
| body: | | ||
| > ✅ Prerelease workflow triggered successfully. | ||
| > | ||
| > View the publish workflow run: ${{ steps.trigger-publish.outputs.workflow-url }} | ||
|
|
||
| - name: Append failure comment | ||
| if: failure() && github.event.inputs.comment-id | ||
| uses: peter-evans/create-or-update-comment@v4 | ||
| with: | ||
| comment-id: ${{ steps.first-comment-action.outputs.comment-id }} | ||
| reactions: confused | ||
| body: | | ||
| > ❌ Failed to trigger prerelease workflow. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.