Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrassia committed Oct 14, 2024
1 parent a41bfc5 commit 695906a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/repository-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ jobs:
git switch rc
RC_COMMIT=$(git log --reverse --pretty=format:"%H" --max-count=1 Directory.Build.props)
echo "rc_commit=$RC_COMMIT" >> $GITHUB_OUTPUT
RC_VERSION=$(xmllint -xpath "/Project/PropertyGroup/Version/text()" Directory.Build.props)
echo "rc_version=$RC_VERSION" >> $GITHUB_OUTPUT
fi
- name: Configure Git
Expand All @@ -197,6 +200,7 @@ jobs:
env:
MAIN_COMMIT: ${{ steps.get-commits.outputs.main_commit }}
RC_COMMIT: ${{ steps.get-commits.outputs.rc_commit }}
RC_VERSION: ${{ steps.get-commits.outputs.rc_version }}
CUT_BRANCH: ${{ inputs.branch_to_cut }}
run: |
# If we are cutting 'hotfix-rc':
Expand All @@ -207,20 +211,23 @@ jobs:
# Chery-pick from 'rc' into 'hotfix-rc'
git switch hotfix-rc
git cherry-pick --allow-empty --strategy-option=theirs -x $RC_COMMIT
git push -u origin hotfix-rc
HOTFIX_RC_VERSION=$(xmllint -xpath "/Project/PropertyGroup/Version/text()" Directory.Build.props)
if [[ "$HOTFIX_RC_VERSION" != "$RC_VERSION" ]]; then
git cherry-pick --strategy-option=theirs -x $RC_COMMIT
git push -u origin hotfix-rc
fi
# Cherry-pick from 'main' into 'rc'
git switch rc
git cherry-pick --allow-empty --strategy-option=theirs -x $MAIN_COMMIT
git cherry-pick --strategy-option=theirs -x $MAIN_COMMIT
git push -u origin rc
# If the 'rc' branch does not exist:
else
# Cherry-pick from 'main' into 'hotfix-rc'
git switch hotfix-rc
git cherry-pick --allow-empty --strategy-option=theirs -x $MAIN_COMMIT
git cherry-pick --strategy-option=theirs -x $MAIN_COMMIT
git push -u origin hotfix-rc
fi
Expand All @@ -230,7 +237,7 @@ jobs:
# Cherry-pick from 'main' into 'rc'
git switch rc
git cherry-pick --allow-empty --strategy-option=theirs -x $MAIN_COMMIT
git cherry-pick --strategy-option=theirs -x $MAIN_COMMIT
git push -u origin rc
fi
Expand Down

0 comments on commit 695906a

Please sign in to comment.