Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 7 additions & 6 deletions .github/workflows/develop-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ jobs:
uses: actions/checkout@v4
with:
ref: main

# Ensure diff between main and develop
- name: "Check if there is a diff between main and develop"
id: check_diff
run: |
git fetch origin develop
DIFF=$(git diff origin/develop..main)
if [ -z "$DIFF" ]; then
echo "No differences found between main and develop."
# Check if there are commits in main that aren't in develop
COMMITS=$(git rev-list origin/develop..main --count)
if [ "$COMMITS" -eq 0 ]; then
echo "No commits found in main that aren't in develop. Develop is up to date or ahead."
echo "diff=false" >> $GITHUB_OUTPUT
else
echo "Differences found between main and develop."
echo "Found $COMMITS commit(s) in main that aren't in develop."
echo "diff=true" >> $GITHUB_OUTPUT
fi
- name: "Check if existing PR exists"
Expand Down Expand Up @@ -119,7 +120,7 @@ jobs:
throw error;
}
}

# PR Creation
- name: "Create Pull Request to update develop branch, and merge it"
id: create_pr
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ The workflow intelligently handles different merge scenarios:

This ensures that hotfixes and other direct merges to `main` are properly reviewed before being merged back to `develop`.

If a merge is not detected, the main and develop branches are already in sync or an existing PR between main and develop exists, the workflow will exit without merging changes, but will create a PR if possible.
If no commits are found in `main` that aren't in `develop`, or an existing PR between main and develop exists, the workflow will exit without merging changes, but will create a PR if possible.

#### Inputs

Expand Down
Loading