1
0
mirror of synced 2024-11-27 17:00:54 +01:00

feat: optimize actions

This commit is contained in:
源文雨 2023-09-21 23:47:31 +09:00
parent f33f18cb0a
commit 0f34027cca
3 changed files with 22 additions and 29 deletions

View File

@ -6,11 +6,9 @@ on:
- dev
jobs:
genlocale:
name: genlocale
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@master
- uses: actions/checkout@master
- name: Run locale generation
run: |
@ -20,15 +18,22 @@ jobs:
- name: Commit back
if: ${{ !github.head_ref }}
id: commitback
continue-on-error: true
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git add --all
git commit -m "🎨 同步 locale"
git commit -m "chore(i18n): sync locale"
- name: Create Pull Request
if: ${{ !github.head_ref }}
if: steps.commitback.outcome == 'success'
continue-on-error: true
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
with:
delete-branch: true
body: "Automatically sync i18n translation jsons"
title: "chore(i18n): sync locale"
commit-message: "chore(i18n): sync locale"
branch: genlocale-${{github.ref_name}}
branch-suffix: short-commit-hash

View File

@ -6,8 +6,7 @@ on:
jobs:
# This workflow closes invalid PR
close-pr:
name: closepr
close_pr:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions: write-all
@ -22,20 +21,14 @@ jobs:
comment: "Invalid PR to non-dev branch ${{ github.event.pull_request.base.ref }}."
pull_format:
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]
fail-fast: false
continue-on-error: true
steps:
- name: checkout
- name: Checkout
continue-on-error: true
uses: actions/checkout@v3
with:

View File

@ -12,14 +12,7 @@ permissions:
jobs:
push_format:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10"]
os: [ubuntu-latest]
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
@ -44,7 +37,7 @@ jobs:
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --all
git commit -m "Format code"
git commit -m "chore(format): run black"
- name: Create Pull Request
if: steps.commitback.outcome == 'success'
@ -52,6 +45,8 @@ jobs:
uses: peter-evans/create-pull-request@v5
with:
delete-branch: true
body: Apply Code Formatter Change
title: Apply Code Formatter Change
commit-message: Automatic code format
body: "Automatically apply code formatter change"
title: "chore(format): run black"
commit-message: "chore(format): run black"
branch: formatter-${{github.ref_name}}
branch-suffix: short-commit-hash