From 0152e4c21739c9401afe9747ff5434478ff6ae9a Mon Sep 17 00:00:00 2001 From: Minh141120 Date: Fri, 21 Mar 2025 07:58:39 +0700 Subject: [PATCH 1/4] ci: update tag --- .github/workflows/upstream-sync.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/upstream-sync.yml b/.github/workflows/upstream-sync.yml index b5ce1d55efb44..2ce9c73d108f6 100644 --- a/.github/workflows/upstream-sync.yml +++ b/.github/workflows/upstream-sync.yml @@ -4,6 +4,9 @@ on: schedule: - cron: '0 0 * * *' # Daily at midnight UTC workflow_dispatch: # Manual trigger + pull_request: + branches: + - main jobs: sync-and-update: @@ -42,7 +45,7 @@ jobs: git checkout -B master FETCH_HEAD git push origin master --force - # Count commits for tagging + # Count commits for tagging - this is the master branch commit count COMMIT_COUNT=$(git rev-list --count HEAD) echo "COMMIT_COUNT=$COMMIT_COUNT" >> $GITHUB_ENV @@ -144,10 +147,13 @@ jobs: echo "PR merged successfully!" - # Create tag + # Create tag using master branch commit count + # We already have COMMIT_COUNT from master branch + TAG_NAME="$COMMIT_COUNT" + + # Checkout dev to apply the tag git fetch origin dev git checkout dev - TAG_NAME="b$COMMIT_COUNT" # Check if tag exists if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then From 64718dda686734497db9d602f3ed6f3a296f8349 Mon Sep 17 00:00:00 2001 From: Minh141120 Date: Fri, 21 Mar 2025 08:00:19 +0700 Subject: [PATCH 2/4] chore: pull request to dev --- .github/workflows/upstream-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upstream-sync.yml b/.github/workflows/upstream-sync.yml index 2ce9c73d108f6..9c8d9e025e92c 100644 --- a/.github/workflows/upstream-sync.yml +++ b/.github/workflows/upstream-sync.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: # Manual trigger pull_request: branches: - - main + - dev jobs: sync-and-update: From 3213416c0dd1013aabaf43107fcc112535db8cd0 Mon Sep 17 00:00:00 2001 From: Minh141120 Date: Fri, 21 Mar 2025 08:05:42 +0700 Subject: [PATCH 3/4] chore: update ci upstream sync --- .github/workflows/upstream-sync.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/upstream-sync.yml b/.github/workflows/upstream-sync.yml index 9c8d9e025e92c..deedf130e8cfd 100644 --- a/.github/workflows/upstream-sync.yml +++ b/.github/workflows/upstream-sync.yml @@ -67,6 +67,10 @@ jobs: BRANCH_NAME="update-dev-from-master-$(date +'%Y-%m-%d-%H-%M')" git checkout -b $BRANCH_NAME + + # Make sure branch contains master content before creating the PR + git merge --no-edit master + git push origin $BRANCH_NAME --force PR_TITLE="Sync master with upstream release $LATEST_TAG" From b4b9eb33880d553e38ce11d3a92b0a9334c0d71f Mon Sep 17 00:00:00 2001 From: Minh141120 Date: Fri, 21 Mar 2025 08:16:12 +0700 Subject: [PATCH 4/4] refactor: remove pull request to dev for testing --- .github/workflows/upstream-sync.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/upstream-sync.yml b/.github/workflows/upstream-sync.yml index deedf130e8cfd..48bcf75dc3990 100644 --- a/.github/workflows/upstream-sync.yml +++ b/.github/workflows/upstream-sync.yml @@ -4,9 +4,6 @@ on: schedule: - cron: '0 0 * * *' # Daily at midnight UTC workflow_dispatch: # Manual trigger - pull_request: - branches: - - dev jobs: sync-and-update: @@ -70,7 +67,7 @@ jobs: # Make sure branch contains master content before creating the PR git merge --no-edit master - + git push origin $BRANCH_NAME --force PR_TITLE="Sync master with upstream release $LATEST_TAG" @@ -152,7 +149,6 @@ jobs: echo "PR merged successfully!" # Create tag using master branch commit count - # We already have COMMIT_COUNT from master branch TAG_NAME="$COMMIT_COUNT" # Checkout dev to apply the tag