Skip to content

Bump gitstream-core to 2.1.238 #244

Bump gitstream-core to 2.1.238

Bump gitstream-core to 2.1.238 #244

# install new gitstream-core version and open PR with new changes
name: Bump gitstream-core
run-name: Bump `gitstream-core` to `${{ inputs.version }}`
on:
workflow_dispatch:
inputs:
version:
description: Version number (ex. "2.1.230")
required: true
default: 2.1.230
ticket:
description: LINBEE-XXXXX ticket number
default: LINBEE-8514
required: false
description:
description: Add a description for this version
required: false
auto-deploy:
description: Add label "auto-deploy" to PR
required: false
type: boolean
default: true
reviewer:
description: GitHub username to assign as reviewer
required: false
jobs:
publish_pr:
name: Publish PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
token: ${{ secrets.CI_USER_GIT_TOKEN }}
- name: Set version to ENV
run: |
echo "VERSION=${{ inputs.version }}" >> "$GITHUB_ENV"
echo "BRANCH_NAME=bump-gitstream-core-to-${{ inputs.version }}" >> "$GITHUB_ENV"
echo "LABEL_ARG=" >> "$GITHUB_ENV"
echo "REVIEWER_ARG=" >> "$GITHUB_ENV"
- name: Set auto-deploy label
if: inputs.auto-deploy
run: |
echo "LABEL_ARG=--label auto-deploy" >> "$GITHUB_ENV"
- name: Set reviewer
run: |
REVIEWER="${{ inputs.reviewer || github.actor }}"
echo "REVIEWER_ARG=--reviewer $REVIEWER" >> "$GITHUB_ENV"
- name: Init npmrc
run: |
curl -H "X-JFrog-Art-API: ${{ secrets.ARTIFACTORY_API_KEY }}" https://linearb.jfrog.io/linearb/api/npm/npm-local/auth/linearb >> .npmrc
- name: Install @linearb/gitstream-core@${{ env.VERSION }}
run: npm install --save --save-exact @linearb/gitstream-core@${{ env.VERSION }}
- name: Run Format & Lint & Test & Build & Package
run: npm run all
- name: Create PR for ${{ env.VERSION }}
id: create-pr
env:
GH_TOKEN: ${{ secrets.CI_USER_GIT_TOKEN }}
run: |
echo -e "${{ inputs.description }}" > pr_description.txt
git config --global user.name 'GitHub Actions Bot'
git config --global user.email 'actions@github.com'
git add package.json package-lock.json dist/index.js
git commit -m "bump @linearb/gitstream-core to ${{ env.VERSION }}"
git push origin HEAD:${{ env.BRANCH_NAME }}
PR_URL=$(gh pr create \
--base develop \
--title 'Bump `@linearb/gitstream-core` to `${{ env.VERSION }}`' \
--body-file pr_description.txt \
--head ${{ env.BRANCH_NAME }} ${{ env.REVIEWER_ARG }} ${{ env.LABEL_ARG }})
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
- name: Output PR URL
if: success()
run: |
echo "✅ PR created successfully: ${{ steps.create-pr.outputs.pr_url }}"
echo "**✅ PR Created**" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.create-pr.outputs.pr_url }}" >> $GITHUB_STEP_SUMMARY