Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIDCS-3286: Auto-set Base Branch to Develop #26

Merged
merged 8 commits into from
Jan 24, 2025

Conversation

dwivedisachin
Copy link
Collaborator

@dwivedisachin dwivedisachin commented Jan 24, 2025

What is this PR doing?

This PR adds a GHA job to make develop as the base branch of the PR only on opening the PR. Which will acts as the default moving forward.
Also, we can re-change the default branch once the job is done to whatever we want.

How should this be manually tested?

Notice below the default of this branch is changed to develop by bot
Logs to the job before the last commit to make it run only on opening the PR

What are the relevant tickets?

Resolves VIDCS-3286

[ ] Resolves a Known Issue.
[ ] If yes, did you remove the item from the docs/KNOWN_ISSUES.md?
[ ] Resolves an item reported in Issues.
If yes, which issue? Issue Number?
[ ] If yes, did you close the item in Issues?

@dwivedisachin dwivedisachin added the WIP Work in progress label Jan 24, 2025
@github-actions github-actions bot changed the base branch from main to develop January 24, 2025 10:04
Copy link
Collaborator

@maikthomas maikthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question

Comment on lines 14 to 23
- name: Check and Update Base Branch
run: |
if [ "${{ github.event.pull_request.base.ref }}" != "develop" ]; then
gh pr edit ${{ github.event.pull_request.number }} --base develop
echo "Base branch updated to 'develop'.";
else
echo "Base branch is already 'develop'.";
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a common case, but I think this should only happen if the target branch is main

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm makes sense!! Doing that.

@dwivedisachin dwivedisachin removed the WIP Work in progress label Jan 24, 2025
@dwivedisachin dwivedisachin changed the base branch from develop to main January 24, 2025 10:30
@github-actions github-actions bot changed the base branch from main to develop January 24, 2025 10:32

- name: Check and Update Base Branch
run: |
if [ "${{ github.event.pull_request.base.ref }}" == "main" ]; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have the logic be
if TARGET_BRANCH == main && BASE_BRANCH != develop
switch to develop

@dwivedisachin dwivedisachin changed the base branch from develop to main January 24, 2025 11:00
@github-actions github-actions bot changed the base branch from main to develop January 24, 2025 11:05
Copy link
Collaborator

@maikthomas maikthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, nice idea @dwivedisachin !

@dwivedisachin dwivedisachin merged commit 6f7b4d9 into develop Jan 24, 2025
7 checks passed
@dwivedisachin dwivedisachin deleted the VIDCS-3286-change-pr-default-base-to-develop branch January 24, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants