Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions .github/workflows/cherryPick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,32 @@ concurrency:
cancel-in-progress: false

jobs:
validate:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Validate pull request URL
if: ${{ inputs.PULL_REQUEST_URL != '' }}
run: |
REPO_FULL_NAME=$(echo '${{ inputs.PULL_REQUEST_URL }}' | sed -E 's|https?://github.com/([^/]+/[^/]+)/pull/.*|\1|')
if [[ "$REPO_FULL_NAME" != ${{ github.repository }} ]] && [[ ! "$REPO_FULL_NAME" =~ Expensify/Mobile-Expensify* ]]; then
echo "::error::❌ Cherry picks are only supported for the Expensify/App and Expensify/Mobile-Expensify repositories. Found: $REPO_FULL_NAME"
exit 1
fi

- name: Verify PR is merged
if: ${{ inputs.PULL_REQUEST_URL != '' }}
run: |
if gh pr view "${{ inputs.PULL_REQUEST_URL }}" --json mergedAt | jq --exit-status '.mergedAt'; then
echo "PR is merged: ${{ inputs.PULL_REQUEST_URL }}"
else
echo "::error::❌ PR is not merged: ${{ inputs.PULL_REQUEST_URL }}"
exit 1
fi

createNewVersion:
uses: ./.github/workflows/createNewVersion.yml
secrets: inherit
needs: [validate]
with:
# In order to submit a new build for production review, it must have a higher PATCH version than the previously-submitted build.
# The typical case is that with each staging deploy, we bump the BUILD version, and with each prod deploy we bump the PATCH version.
Expand All @@ -59,14 +82,6 @@ jobs:
echo "REPO_FULL_NAME=$(echo '${{ inputs.PULL_REQUEST_URL }}' | sed -E 's|https?://github.com/([^/]+/[^/]+)/pull/.*|\1|')" >> "$GITHUB_OUTPUT"
echo "PR_NUMBER=$(echo '${{ inputs.PULL_REQUEST_URL }}' | sed -E 's|.*/pull/([0-9]+).*|\1|')" >> "$GITHUB_OUTPUT"

- name: Verify pull request URL
if: ${{ inputs.PULL_REQUEST_URL != '' }}
run: |
if [[ "${{ steps.getPRInfo.outputs.REPO_FULL_NAME }}" != ${{ github.repository }} ]] && [[ ! "${{ steps.getPRInfo.outputs.REPO_FULL_NAME }}" =~ Expensify/Mobile-Expensify* ]]; then
echo "::error::❌ Cherry picks are only supported for the Expensify/App and Expensify/Mobile-Expensify repositories. Found: ${{ steps.getPRInfo.outputs.REPO_FULL_NAME }}"
exit 1
fi

- name: Set conflict branch name
if: ${{ inputs.PULL_REQUEST_URL != '' }}
id: getBranchName
Expand Down
Loading