-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35891 from appsmithorg/release
27/08 Daily Promotion
- Loading branch information
Showing
285 changed files
with
3,181 additions
and
3,287 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ on: | |
pull_request: | ||
branches: | ||
- release | ||
- master | ||
- pg | ||
types: [ labeled, synchronize ] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Merge release to pg | ||
|
||
on: | ||
push: | ||
branches: | ||
- release # Trigger on push to the release branch | ||
|
||
jobs: | ||
merge-release-to-pg: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout release branch | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: release # Checkout the release branch | ||
|
||
- name: Fetch all branches | ||
run: git fetch origin pg | ||
|
||
- name: Checkout pg branch | ||
run: git checkout pg | ||
|
||
- name: Merge release to pg | ||
id: merge_commits | ||
run: | | ||
PG_HEAD=$(git rev-parse pg) | ||
RELEASE_HEAD=$(git rev-parse release) | ||
echo "PG_HEAD=$PG_HEAD" | ||
echo "RELEASE_HEAD=$RELEASE_HEAD" | ||
# Checkout the pg branch | ||
git checkout pg | ||
# Attempt to merge release into pg | ||
if ! git merge release; then | ||
echo "Merge conflict detected during merge" | ||
# Capture the conflicting commit SHAs (both HEAD of pg and the merge commit from release) | ||
CONFLICTING_COMMIT=$(git log -1 --pretty=format:"%H") | ||
echo "CONFLICTING_COMMIT=$CONFLICTING_COMMIT" >> $GITHUB_ENV | ||
git merge --abort | ||
echo "MERGE_CONFLICT=true" >> $GITHUB_ENV | ||
else | ||
echo "MERGE_CONFLICT=false" >> $GITHUB_ENV | ||
fi | ||
- name: Push changes | ||
if: env.MERGE_CONFLICT == 'false' | ||
run: | | ||
git push origin pg | ||
- name: Notify on merge conflicts | ||
if: env.MERGE_CONFLICT == 'true' | ||
env: | ||
REPOSITORY_URL: ${{ github.repositoryUrl }} | ||
CONFLICTING_COMMIT: ${{ env.CONFLICTING_COMMIT }} | ||
run: | | ||
# Prepare the message for Slack | ||
message="Merge conflict detected while merging release into pg branch. Conflicted commits:\n" | ||
commit_url="$REPOSITORY_URL/commit/$CONFLICTING_COMMIT" | ||
message+="$commit_url\n" | ||
# Send the message to Slack | ||
# This unwieldy horror of a sed command, converts standard Markdown links to Slack's unwieldy link syntax. | ||
slack_message="$(echo "$message" | sed -E 's/\[([^]]+)\]\(([^)]+)\)/<\2|\1>/g')" | ||
# This is the ChannelId of the proj postgres channel. | ||
body="$(jq -nc \ | ||
--arg channel C06Q3A97USE \ | ||
--arg text "$slack_message" \ | ||
'$ARGS.named' | ||
)" | ||
curl --version | ||
curl -v https://slack.com/api/chat.postMessage \ | ||
--header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \ | ||
--header 'Content-Type: application/json; charset=utf-8' \ | ||
--data-raw "$body" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.