mirror of
https://github.com/daydreamer-json/ak-endfield-api-archive.git
synced 2026-04-05 15:12:21 +02:00
ci: add fallback git commit and push logic
This commit is contained in:
20
.github/workflows/main.yml
vendored
20
.github/workflows/main.yml
vendored
@@ -20,6 +20,10 @@ jobs:
|
|||||||
uses: oven-sh/setup-bun@v2
|
uses: oven-sh/setup-bun@v2
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
|
- name: Configure git
|
||||||
|
run: |
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
- name: Create config auth
|
- name: Create config auth
|
||||||
env:
|
env:
|
||||||
CONFIG_AUTH_YAML_CTX: ${{ secrets.CONFIG_AUTH_YAML }}
|
CONFIG_AUTH_YAML_CTX: ${{ secrets.CONFIG_AUTH_YAML }}
|
||||||
@@ -35,6 +39,8 @@ jobs:
|
|||||||
- name: Format output folder
|
- name: Format output folder
|
||||||
run: bun x oxfmt output
|
run: bun x oxfmt output
|
||||||
- name: Git commit and push
|
- name: Git commit and push
|
||||||
|
id: commit_1
|
||||||
|
continue-on-error: true
|
||||||
uses: iarekylew00t/verified-bot-commit@v2
|
uses: iarekylew00t/verified-bot-commit@v2
|
||||||
with:
|
with:
|
||||||
message: "[Auto] API update"
|
message: "[Auto] API update"
|
||||||
@@ -43,6 +49,12 @@ jobs:
|
|||||||
output/raw/**
|
output/raw/**
|
||||||
output/mirror_file_list.json
|
output/mirror_file_list.json
|
||||||
if-no-commit: info
|
if-no-commit: info
|
||||||
|
- name: Git commit and push (Fallback)
|
||||||
|
if: steps.commit_1.outcome == 'failure'
|
||||||
|
run: |
|
||||||
|
git add output/akEndfield/** output/raw/** output/mirror_file_list.json
|
||||||
|
git commit -m "[Auto] API update" || echo "No changes to commit"
|
||||||
|
git push
|
||||||
- name: Run GitHub mirror upload
|
- name: Run GitHub mirror upload
|
||||||
run: bun run src/main.ts ghMirrorUpload
|
run: bun run src/main.ts ghMirrorUpload
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -51,6 +63,8 @@ jobs:
|
|||||||
- name: Git pull
|
- name: Git pull
|
||||||
run: git pull
|
run: git pull
|
||||||
- name: Git commit and push
|
- name: Git commit and push
|
||||||
|
id: commit_2
|
||||||
|
continue-on-error: true
|
||||||
uses: iarekylew00t/verified-bot-commit@v2
|
uses: iarekylew00t/verified-bot-commit@v2
|
||||||
with:
|
with:
|
||||||
message: "[Auto] API update"
|
message: "[Auto] API update"
|
||||||
@@ -58,3 +72,9 @@ jobs:
|
|||||||
output/mirror_file_list.json
|
output/mirror_file_list.json
|
||||||
output/mirror_file_list_pending.json
|
output/mirror_file_list_pending.json
|
||||||
if-no-commit: info
|
if-no-commit: info
|
||||||
|
- name: Git commit and push (Fallback)
|
||||||
|
if: steps.commit_2.outcome == 'failure'
|
||||||
|
run: |
|
||||||
|
git add output/mirror_file_list.json output/mirror_file_list_pending.json
|
||||||
|
git commit -m "[Auto] API update" || echo "No changes to commit"
|
||||||
|
git push
|
||||||
|
|||||||
Reference in New Issue
Block a user