-
Notifications
You must be signed in to change notification settings - Fork 21
feat(release): add alpha releases from pull request branches #626
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
Merged
Changes from all commits
Commits
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,195 @@ | ||
| name: Alpha Release | ||
|
|
||
| # Publishes a worker from a feature branch for integration testing without | ||
| # touching the branch or main. The tag points at an ephemeral commit whose | ||
| # manifest is bumped to an alpha version; only the tag is pushed. | ||
| # | ||
| # The regular release workflow handles this tag normally, producing a GitHub | ||
| # prerelease and publishing the worker to the isolated `experimental` channel. | ||
| # Run this workflow from main and provide the feature branch or pull-request | ||
| # ref to release. That lets it test PRs created before this workflow existed. | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| source_ref: | ||
| description: 'Feature branch or pull-request ref (e.g. feat/my-worker or refs/pull/123/head)' | ||
| required: true | ||
| type: string | ||
| worker: | ||
| description: 'Worker module to publish from this branch' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - acp | ||
| - approval-gate | ||
| - bridge | ||
| - browser | ||
| - claude-code | ||
| - codex | ||
| - devin | ||
| - console | ||
| - grok | ||
| - context-manager | ||
| - cron | ||
| - database | ||
| - eval | ||
| - harness | ||
| - hermes | ||
| - http | ||
| - iii-directory | ||
| - lsp | ||
| - image-resize | ||
| - llm-router | ||
| - fp | ||
| - github | ||
| - mcp | ||
| - memory | ||
| - memory-consolidate | ||
| - opencode | ||
| - pi | ||
| - provider-anthropic | ||
| - provider-claude-code | ||
| - provider-kimi | ||
| - provider-llamacpp | ||
| - provider-openai | ||
| - provider-openai-codex | ||
| - provider-xai | ||
| - provider-zai | ||
| - pubsub | ||
| - queue | ||
| - rbac-proxy | ||
| - session-manager | ||
| - slack | ||
| - telegram-bot | ||
| - shell | ||
| - state | ||
| - storage | ||
| - scrapling | ||
| - web | ||
| - worktree | ||
| bump: | ||
| description: 'Base version for the alpha (none = use the manifest version as its base)' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - patch | ||
| - minor | ||
| - major | ||
| - none | ||
| default: patch | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: alpha-release-${{ inputs.worker }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| prepare: | ||
| name: Bump and tag alpha | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - name: Checkout source ref | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| ref: ${{ inputs.source_ref }} | ||
|
|
||
| - name: Refuse to release main | ||
| env: | ||
| SOURCE_REF: ${{ inputs.source_ref }} | ||
| run: | | ||
| set -euo pipefail | ||
| git fetch origin main | ||
| source_sha=$(git rev-parse HEAD) | ||
| main_sha=$(git rev-parse origin/main) | ||
| if [[ "$source_sha" == "$main_sha" ]]; then | ||
| echo "::error::Alpha Release is for feature branches; use Create Tag for main releases" | ||
| exit 1 | ||
| fi | ||
| echo "::notice::Preparing alpha release from $SOURCE_REF at $source_sha" | ||
|
|
||
| - name: Discover manifest | ||
| id: meta | ||
| env: | ||
| WORKER: ${{ inputs.worker }} | ||
| run: | | ||
| set -euo pipefail | ||
| if [[ ! -f "$WORKER/iii.worker.yaml" ]]; then | ||
| echo "::error::$WORKER/iii.worker.yaml is missing" | ||
| exit 1 | ||
| fi | ||
| manifest=$(grep '^manifest:' "$WORKER/iii.worker.yaml" | head -n1 | awk '{print $2}') | ||
| if [[ -z "$manifest" ]]; then | ||
| echo "::error::$WORKER/iii.worker.yaml has no 'manifest' key" | ||
| exit 1 | ||
| fi | ||
| echo "manifest=$manifest" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Calculate and write alpha version | ||
| id: version | ||
| env: | ||
| WORKER: ${{ inputs.worker }} | ||
| BUMP: ${{ inputs.bump }} | ||
| MANIFEST: ${{ steps.meta.outputs.manifest }} | ||
| run: | | ||
| set -euo pipefail | ||
| version=$(python3 .github/scripts/manifest_version.py bump "$WORKER/$MANIFEST" \ | ||
| --kind "$BUMP" --suffix alpha --worker "$WORKER") | ||
| echo "version=$version" >> "$GITHUB_OUTPUT" | ||
| echo "tag=${WORKER}/v${version}" >> "$GITHUB_OUTPUT" | ||
| echo "::notice::${WORKER}: alpha ${version}@experimental" | ||
|
|
||
| - name: Validate manifest update | ||
| env: | ||
| WORKER: ${{ inputs.worker }} | ||
| MANIFEST: ${{ steps.meta.outputs.manifest }} | ||
| VERSION: ${{ steps.version.outputs.version }} | ||
| run: | | ||
| set -euo pipefail | ||
| python3 .github/scripts/manifest_version.py verify \ | ||
| "$WORKER/$MANIFEST" --expected "$VERSION" | ||
|
|
||
| - name: Sync Cargo.lock to alpha version | ||
| env: | ||
| WORKER: ${{ inputs.worker }} | ||
| MANIFEST: ${{ steps.meta.outputs.manifest }} | ||
| run: | | ||
| set -euo pipefail | ||
| python3 .github/scripts/manifest_version.py sync-lock "$WORKER/$MANIFEST" | ||
|
|
||
| - name: Check tag does not exist | ||
| env: | ||
| TAG: ${{ steps.version.outputs.tag }} | ||
| run: | | ||
| if git rev-parse "$TAG" >/dev/null 2>&1; then | ||
| echo "::error::Tag $TAG already exists" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Commit alpha version and push only its tag | ||
| env: | ||
| TAG: ${{ steps.version.outputs.tag }} | ||
| WORKER: ${{ inputs.worker }} | ||
| VERSION: ${{ steps.version.outputs.version }} | ||
| run: | | ||
| set -euo pipefail | ||
| git config user.name "workers-ci[bot]" | ||
| git config user.email "workers-ci[bot]@users.noreply.github.com" | ||
| git add -A | ||
| git commit -m "chore(${WORKER}): alpha v${VERSION} [skip ci]" | ||
| git tag -a "$TAG" -m "Alpha release $TAG | ||
|
|
||
| worker: $WORKER | ||
| version: $VERSION | ||
| registry-tag: experimental | ||
| " | ||
| # The ephemeral commit is reachable only through this tag. Never | ||
| # push the selected feature branch or main from this workflow. | ||
| git push origin "$TAG" | ||
| echo "::notice::Published $TAG@experimental" | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🔴 Critical | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: iii-hq/workers
Length of output: 416
🏁 Script executed:
Repository: iii-hq/workers
Length of output: 7929
🌐 Web query:
actions/checkout persist-credentials default true README💡 Result:
The persist-credentials input for the actions/checkout GitHub Action determines whether the authentication token or SSH key used for the checkout is configured in the local git configuration [1][2]. By default, persist-credentials is set to true [1][2]. When enabled, this allows subsequent steps in the same job to execute authenticated git commands using those credentials [3][4]. The action removes these credentials from the local git configuration during the post-job cleanup phase [3][5]. If you wish to prevent these credentials from being stored in the local git configuration, you can set persist-credentials to false [3][6]. This is often recommended for security purposes to ensure that subsequent steps in a workflow cannot access the repository token if they do not require it [7].
Citations:
persist-credentialsor change the default tofalseactions/checkout#485Do not execute release tooling from the caller-selected ref.
The workflow checks out
inputs.source_refbut later runs.github/scripts/manifest_version.pyfromactions/checkout’s default persistedGITHUB_TOKEN; after that, Git commands can push arbitrary refs before the explicitgit push origin "$TAG". Keep checkout credentials disabled for the selected source, fetch the trusted release tooling/_lib.pyfrommain, and use a scoped push token only where the tag is pushed.🧰 Tools
🪛 zizmor (1.28.0)
[warning] 97-101: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools