Skip to content

Commit 0f34027

Browse files
committed
feat: optimize actions
1 parent f33f18c commit 0f34027

File tree

3 files changed

+22
-29
lines changed

3 files changed

+22
-29
lines changed

.github/workflows/genlocale.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ on:
66
- dev
77
jobs:
88
genlocale:
9-
name: genlocale
109
runs-on: ubuntu-latest
1110
steps:
12-
- name: Check out
13-
uses: actions/checkout@master
11+
- uses: actions/checkout@master
1412

1513
- name: Run locale generation
1614
run: |
@@ -20,15 +18,22 @@ jobs:
2018
2119
- name: Commit back
2220
if: ${{ !github.head_ref }}
21+
id: commitback
2322
continue-on-error: true
2423
run: |
2524
git config --local user.name 'github-actions[bot]'
2625
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
2726
git add --all
28-
git commit -m "🎨 同步 locale"
27+
git commit -m "chore(i18n): sync locale"
2928
3029
- name: Create Pull Request
31-
if: ${{ !github.head_ref }}
30+
if: steps.commitback.outcome == 'success'
3231
continue-on-error: true
33-
uses: peter-evans/create-pull-request@v4
34-
32+
uses: peter-evans/create-pull-request@v5
33+
with:
34+
delete-branch: true
35+
body: "Automatically sync i18n translation jsons"
36+
title: "chore(i18n): sync locale"
37+
commit-message: "chore(i18n): sync locale"
38+
branch: genlocale-${{github.ref_name}}
39+
branch-suffix: short-commit-hash

.github/workflows/pull_format.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ on:
66

77
jobs:
88
# This workflow closes invalid PR
9-
close-pr:
10-
name: closepr
9+
close_pr:
1110
# The type of runner that the job will run on
1211
runs-on: ubuntu-latest
1312
permissions: write-all
@@ -22,20 +21,14 @@ jobs:
2221
comment: "Invalid PR to non-dev branch ${{ github.event.pull_request.base.ref }}."
2322

2423
pull_format:
25-
runs-on: ${{ matrix.os }}
24+
runs-on: ubuntu-latest
2625
permissions:
2726
contents: write
2827

29-
strategy:
30-
matrix:
31-
python-version: ["3.10"]
32-
os: [ubuntu-latest]
33-
fail-fast: false
34-
3528
continue-on-error: true
3629

3730
steps:
38-
- name: checkout
31+
- name: Checkout
3932
continue-on-error: true
4033
uses: actions/checkout@v3
4134
with:

.github/workflows/push_format.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ permissions:
1212

1313
jobs:
1414
push_format:
15-
runs-on: ${{ matrix.os }}
16-
17-
strategy:
18-
matrix:
19-
python-version: ["3.10"]
20-
os: [ubuntu-latest]
21-
fail-fast: false
22-
15+
runs-on: ubuntu-latest
2316
steps:
2417
- uses: actions/checkout@v3
2518
with:
@@ -44,14 +37,16 @@ jobs:
4437
git config --local user.email "github-actions[bot]@users.noreply.github.com"
4538
git config --local user.name "github-actions[bot]"
4639
git add --all
47-
git commit -m "Format code"
40+
git commit -m "chore(format): run black"
4841
4942
- name: Create Pull Request
5043
if: steps.commitback.outcome == 'success'
5144
continue-on-error: true
5245
uses: peter-evans/create-pull-request@v5
5346
with:
5447
delete-branch: true
55-
body: Apply Code Formatter Change
56-
title: Apply Code Formatter Change
57-
commit-message: Automatic code format
48+
body: "Automatically apply code formatter change"
49+
title: "chore(format): run black"
50+
commit-message: "chore(format): run black"
51+
branch: formatter-${{github.ref_name}}
52+
branch-suffix: short-commit-hash

0 commit comments

Comments
 (0)