Skip to content

Commit 0276dd6

Browse files
Update CI/CD
1 parent eedf888 commit 0276dd6

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
steps:
1616
- name: Checkout repository
1717
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
1820

1921
- name: Set up Node.js
2022
uses: actions/setup-node@v2
@@ -35,6 +37,10 @@ jobs:
3537
COVERAGE=$(cat coverage/coverage-summary.json | jq '.total.lines.pct')
3638
echo "![Coverage](https://img.shields.io/badge/coverage-${COVERAGE}%25-brightgreen)" > coverage/coverage_badge.md
3739
40+
- name: Create and switch to a new branch
41+
run: |
42+
git checkout -b update-coverage-badge
43+
3844
- name: Update README with coverage badge
3945
run: |
4046
BADGE_CONTENT=$(cat coverage/coverage_badge.md)
@@ -46,6 +52,14 @@ jobs:
4652
git config --local user.name "${{ secrets.GIT_USER_NAME }}"
4753
git add README.md
4854
git commit -m "Update coverage badge"
49-
git push
55+
git push origin update-coverage-badge
5056
env:
5157
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: Create Pull Request
60+
uses: peter-evans/create-pull-request@v3
61+
with:
62+
title: "Update coverage badge"
63+
body: "This PR updates the coverage badge in README."
64+
base: main
65+
head: update-coverage-badge

0 commit comments

Comments
 (0)