Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix: use PAT in create-release.yml so downstream workflows trigger (#921)

Rohit Malhotraf7005a02afa9
diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml
index 9d6d82ac35..c8707e5d89 100644
--- a/.github/workflows/create-release.yml
+++ b/.github/workflows/create-release.yml
@@ -69,7 +69,11 @@ jobs:
- name: Create GitHub Release
if: steps.check.outputs.exists == 'false'
env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ # Use a PAT (not GITHUB_TOKEN) so the resulting tag-push event
+ # propagates to downstream workflows (npm-publish.yml, docker.yml).
+ # Tags created via GITHUB_TOKEN are silently suppressed by GitHub
+ # and will not trigger other workflow runs.
+ GH_TOKEN: ${{ secrets.OPENHANDS_BOT_GITHUB_PAT_PUBLIC || secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
PREV_TAG: ${{ steps.prev_tag.outputs.prev_tag }}
run: |
diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml
index 56a8a14c96..134fa51b86 100644
--- a/.github/workflows/npm-publish.yml
+++ b/.github/workflows/npm-publish.yml
@@ -4,9 +4,15 @@ on:
push:
tags:
- 'v*'
+ workflow_dispatch:
+ inputs:
+ tag:
+ description: 'Release tag to publish (e.g. v1.0.0-alpha.8)'
+ required: true
+ type: string
concurrency:
- group: npm-publish-${{ github.ref }}
+ group: npm-publish-${{ inputs.tag || github.ref }}
cancel-in-progress: false
permissions:
@@ -22,6 +28,8 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v6
+ with:
+ ref: ${{ inputs.tag || github.ref }}
# Trusted publishing requires Node 22.14.0+ and npm 11.5.1+
# See: https://docs.npmjs.com/trusted-publishers/
@@ -61,9 +69,19 @@ jobs:
run: npm pack --dry-run
- name: Validate package version matches release tag
+ env:
+ # Pass inputs.tag via env var to prevent script injection from
+ # GitHub Actions expression interpolation inside run blocks.
+ INPUT_TAG: ${{ inputs.tag }}
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
- TAG_VERSION=${GITHUB_REF#refs/tags/v}
+ # Resolve tag: prefer workflow_dispatch input, fall back to push-event GITHUB_REF
+ if [ -n "$INPUT_TAG" ]; then
+ RAW_TAG="$INPUT_TAG"
+ else
+ RAW_TAG="${GITHUB_REF#refs/tags/}"
+ fi
+ TAG_VERSION="${RAW_TAG#v}"
echo "Package version: $PACKAGE_VERSION"
echo "Release tag version: $TAG_VERSION"
if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then