mirror of
https://github.com/kevinthedang/discord-ollama.git
synced 2026-08-08 23:54:01 -04:00
make badge commit explicit
This commit is contained in:
@@ -5,11 +5,15 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
types: [opened, synchronize, reopened, closed]
|
types: [opened, reopened]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: coverage-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Discord-Node-Coverage:
|
Discord-Node-Coverage:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -18,6 +22,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ github.head_ref }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Node Environment
|
- name: Set up Node Environment
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
@@ -48,9 +55,20 @@ jobs:
|
|||||||
badge-path: ./imgs/coverage.svg
|
badge-path: ./imgs/coverage.svg
|
||||||
upload-badge: false
|
upload-badge: false
|
||||||
|
|
||||||
- name: Commit badge with merge
|
- name: Check whether badge commit is already latest
|
||||||
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
|
id: badge-check
|
||||||
|
if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.action == 'reopened')
|
||||||
|
run: |
|
||||||
|
if [ "$(git log -1 --pretty=%s)" = "update with coverage badge" ]; then
|
||||||
|
echo "already_latest=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "already_latest=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Commit badge to PR branch
|
||||||
|
if: github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.action == 'reopened') && steps.badge-check.outputs.already_latest != 'true'
|
||||||
uses: stefanzweifel/git-auto-commit-action@v7
|
uses: stefanzweifel/git-auto-commit-action@v7
|
||||||
with:
|
with:
|
||||||
file_pattern: ./imgs/coverage.svg
|
file_pattern: ./imgs/coverage.svg
|
||||||
commit_message: 'update with coverage badge'
|
commit_message: 'update with coverage badge'
|
||||||
|
branch: ${{ github.head_ref }}
|
||||||
|
|||||||
Reference in New Issue
Block a user