Skip to content

VIDCS-3400: just trying out #44

VIDCS-3400: just trying out

VIDCS-3400: just trying out #44

Workflow file for this run

name: Auto-set Base Branch to Develop
on:
pull_request:
types: [opened]
permissions:
contents: read
jobs:
set-base-branch:
runs-on: ubuntu-22.04
permissions:
pull-requests: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Check and Update Base Branch
env:
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
BASE_BRANCH: ${{ github.event.pull_request.head.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
if [ "$TARGET_BRANCH" = "main" ] && [ "$BASE_BRANCH" != "develop" ]; then
echo "Switching base branch from $TARGET_BRANCH to develop..."
gh pr edit "$PR_NUMBER" --base "develop"
echo "Base branch updated to 'develop'."
else
echo "No changes needed: Target branch is '$TARGET_BRANCH' and base branch is '$BASE_BRANCH'."
fi