From 61da63309daa091a86c12ec4408d902fdac58081 Mon Sep 17 00:00:00 2001 From: guozichun Date: Thu, 25 Apr 2024 02:37:02 +0800 Subject: [PATCH 1/4] ci(CI&CD): :ferris_wheel: cI --- .github/workflows/Test.yml | 40 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 032a3f8..972d493 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -2,14 +2,8 @@ name: ๐Ÿงช Test on: push: branches: - - "**" - - "!main" - - "!master" - pull_request: - branches: - - "**" - - "!main" - - "!master" + - develop + - release/** defaults: run: shell: bash @@ -19,17 +13,17 @@ jobs: name: Test runs-on: ubuntu-latest steps: - - name: โฌ‡๏ธ Checkout - id: checkout - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: ๐ŸŸข Setup node id: setup-node uses: actions/setup-node@v4 with: - node-version: 20 + node-version: latest + + - name: โฌ‡๏ธ Checkout + id: checkout + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: ๐Ÿฅก Setup pnpm id: setup-pnpm @@ -40,8 +34,7 @@ jobs: - name: ๐ŸŽˆ Get pnpm store directory id: get-pnpm-cache-dir - run: | - echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" + run: echo "pnpm_cache_dir=$(pnpm store path)" >> "$GITHUB_OUTPUT" - name: ๐Ÿ”† Cache pnpm modules uses: actions/cache@v4 @@ -59,14 +52,19 @@ jobs: - name: Test run: pnpm run test + - name: Reset promotion branch + run: | + git fetch origin main:main + git reset --hard main + - name: Create Pull Request uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.ref }} + branch: develop base: main - title: "Pull Request form Actions By ${{ github.ref }}" - body: "This is a pull request created by Actions" - commit-message: "Pull Request main into ${{ github.ref }}" + title: "Pull Request form Github Actions" + body: "This is a pull request created by Actions Robot ๐Ÿค–" + commit-message: "Pull Request ${{ github.head_ref }} into main" labels: "CI" assignees: "guotingchao" From 043b6cfd682d9a0e123b8bab94d9a5aa456b71ed Mon Sep 17 00:00:00 2001 From: guozichun Date: Thu, 25 Apr 2024 02:43:31 +0800 Subject: [PATCH 2/4] ci(CI&CD): :ferris_wheel: cI --- .github/workflows/Test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 972d493..7c02939 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -4,6 +4,7 @@ on: branches: - develop - release/** + - hotfix/** defaults: run: shell: bash @@ -61,8 +62,8 @@ jobs: uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - branch: develop - base: main + branch: main + base: ${{ github.head_ref }} title: "Pull Request form Github Actions" body: "This is a pull request created by Actions Robot ๐Ÿค–" commit-message: "Pull Request ${{ github.head_ref }} into main" From 7731084c10d3b53e09caf89c617af747059eb19d Mon Sep 17 00:00:00 2001 From: guozichun Date: Thu, 25 Apr 2024 02:49:06 +0800 Subject: [PATCH 3/4] fix(bug fix): :bug: cI --- .github/workflows/Test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 7c02939..a9e9532 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -62,8 +62,8 @@ jobs: uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - branch: main - base: ${{ github.head_ref }} + branch: ${{ github.head_ref }} + base: main title: "Pull Request form Github Actions" body: "This is a pull request created by Actions Robot ๐Ÿค–" commit-message: "Pull Request ${{ github.head_ref }} into main" From 15db6773049661cc21a3c645c5b758b971427799 Mon Sep 17 00:00:00 2001 From: Guo ZiChun Date: Thu, 25 Apr 2024 02:51:38 +0800 Subject: [PATCH 4/4] Update Test.yml --- .github/workflows/Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index a9e9532..369b50b 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -62,7 +62,7 @@ jobs: uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - branch: ${{ github.head_ref }} + branch: ${{ github.ref }} base: main title: "Pull Request form Github Actions" body: "This is a pull request created by Actions Robot ๐Ÿค–"