mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-22 20:04:56 +01:00
Update GitHub actions
This commit is contained in:
35
.github/workflows/check_code.yml
vendored
35
.github/workflows/check_code.yml
vendored
@@ -7,6 +7,7 @@ on:
|
||||
- "src/main/**.java"
|
||||
- "**.json"
|
||||
branches:
|
||||
- "development"
|
||||
- "unstable"
|
||||
|
||||
jobs:
|
||||
@@ -17,6 +18,10 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Extract branch name
|
||||
shell: bash
|
||||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
||||
id: extract_branch
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
@@ -38,10 +43,36 @@ jobs:
|
||||
- run: git config --global user.name "github-actions"
|
||||
- run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
- run: git stash
|
||||
- run: git checkout unstable && git pull
|
||||
- run: git checkout ${{ steps.extract_branch.outputs.branch }} && git pull
|
||||
- run: git stash pop || true
|
||||
|
||||
- name: Commit Code Changes
|
||||
run: git add -u && git commit -m 'Format code [skip actions]' || true
|
||||
- name: Push Code Changes
|
||||
run: git push --set-upstream --force origin unstable
|
||||
run: git push --set-upstream --force origin ${{ steps.extract_branch.outputs.branch }}
|
||||
|
||||
Update-Languages:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Extract branch name
|
||||
shell: bash
|
||||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
||||
id: extract_branch
|
||||
|
||||
- name: Update Languages
|
||||
run: python scripts/manage_languages.py -u
|
||||
|
||||
- run: git config --global user.name "github-actions"
|
||||
- run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
- run: git stash
|
||||
- run: git checkout ${{ steps.extract_branch.outputs.branch }} && git pull
|
||||
- run: git stash pop || true
|
||||
|
||||
- name: Commit any language changes
|
||||
run: git add -u && git commit -m 'Update languages [skip actions]' || true
|
||||
- name: Push language changes
|
||||
run: git push --set-upstream --force origin ${{ steps.extract_branch.outputs.branch }}
|
||||
|
||||
Reference in New Issue
Block a user