mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 16:58:47 +01:00
Less noisy action
This commit is contained in:
parent
6e59faada4
commit
86bfde01e8
1 changed files with 5 additions and 9 deletions
14
.github/workflows/i18n-automerge.yml
vendored
14
.github/workflows/i18n-automerge.yml
vendored
|
@ -3,7 +3,6 @@ name: i18n PR auto-merge
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize, reopened, labeled]
|
types: [opened, synchronize, reopened, labeled]
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-and-merge:
|
run-and-merge:
|
||||||
|
@ -21,7 +20,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Count lines changed
|
- name: Merge PR if there are significant changes
|
||||||
run: |
|
run: |
|
||||||
BASE_SHA="${{ github.event.pull_request.base.sha }}"
|
BASE_SHA="${{ github.event.pull_request.base.sha }}"
|
||||||
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
|
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
|
||||||
|
@ -48,7 +47,7 @@ jobs:
|
||||||
# Check if the number of lines changed is more than 50
|
# Check if the number of lines changed is more than 50
|
||||||
if [ "$LINES_CHANGED" -le 50 ]; then
|
if [ "$LINES_CHANGED" -le 50 ]; then
|
||||||
echo "ERROR: 50 or fewer lines have been changed. Failing the check."
|
echo "ERROR: 50 or fewer lines have been changed. Failing the check."
|
||||||
exit 1
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Success: More than 50 lines have been changed."
|
echo "Success: More than 50 lines have been changed."
|
||||||
node scripts/catalogs.js
|
node scripts/catalogs.js
|
||||||
|
@ -59,13 +58,10 @@ jobs:
|
||||||
git add src/data/catalogs.json
|
git add src/data/catalogs.json
|
||||||
git commit -m "Update catalogs.json"
|
git commit -m "Update catalogs.json"
|
||||||
git push
|
git push
|
||||||
|
echo "Merging pull request"
|
||||||
|
PR_NUMBER=$(echo ${{ github.event.pull_request.number }})
|
||||||
|
gh pr merge $PR_NUMBER --auto --squash
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Merge pull request
|
|
||||||
if: ${{ success() }}
|
|
||||||
run: |
|
|
||||||
PR_NUMBER=$(echo ${{ github.event.pull_request.number }})
|
|
||||||
gh pr merge $PR_NUMBER --auto --squash
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
Loading…
Reference in a new issue