Files
self/.github/actions/create-version-bump-pr/action.yml
Justin Hernandez a66c5907eb SELF-832: tweak mobile deploy auto bump version pr feature; v2.7.0 (#1244)
* bump version to match staging

* save wip

* deploy fixes

* fix version setting

* update version logic

* fix version pr

* increase timeout to 2 hours

* pr logic tweaks

* fix script

* fix script path

* add comments and update logic to test from feature branch

* fix build path

* fix version input error

* fix pulling version

* add skip-deploy lable

* address cr concners
2025-10-10 00:17:01 -07:00

63 lines
2.0 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Create Version Bump PR
description: Creates a PR from staging changes onto dev branch
inputs:
platform:
description: Platform name (ios or android)
required: true
version:
description: Current version string
required: true
file_paths:
description: File paths to include in the PR (newline separated)
required: true
github_token:
description: GitHub token for creating PR
required: true
runs:
using: composite
steps:
- name: Create version bump PR
shell: bash
run: |
BRANCH_NAME="ci/bump-${{ inputs.platform }}-build-${{ github.run_id }}"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Ensure we're on staging branch, not detached HEAD
git fetch origin staging dev
git checkout staging
# Check if staging has commits not in dev (version bumps + any build changes)
COMMITS_AHEAD=$(git rev-list --count origin/dev..staging)
if [ "$COMMITS_AHEAD" -eq 0 ]; then
echo " No new commits on staging compared to dev. Skipping PR creation."
exit 0
fi
echo "📊 Staging is $COMMITS_AHEAD commit(s) ahead of dev"
# Create new branch from current staging (which has all version changes)
git checkout -b ${BRANCH_NAME}
# Push the branch
git push --set-upstream origin ${BRANCH_NAME}
# Determine PR title based on platform
if [ "${{ inputs.platform }}" = "mobile" ]; then
PR_TITLE="chore: bump mobile app version to ${{ inputs.version }}"
else
PR_TITLE="chore: bump ${{ inputs.platform }} build for ${{ inputs.version }}"
fi
gh pr create \
--base dev \
--head ${BRANCH_NAME} \
--title "$PR_TITLE" \
--body "Automated version bump by CI" \
--label "automated"
env:
GH_TOKEN: ${{ inputs.github_token }}