Skip to content

Commit

Permalink
Merge pull request #1 from cctan777/test
Browse files Browse the repository at this point in the history
test
  • Loading branch information
cctan777 authored Jan 16, 2023
2 parents 70cb2c5 + a0c73b3 commit a6bdfa3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/create-badge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ jobs:
badge=`echo $badge | sed 's/.$//'`
echo $badge
- name: Get Current Branch Name
run: |
echo Branch name is ${GITHUB_REF##*/}
echo Branch name is ${{ github.ref_name }}
echo Branch name is ${{ github.head_ref }}
- name: Update README.md with Code Coverage Badge
run: sed -i -e "s|<coverage-badge>.*</coverage-badge>|<coverage-badge>[![]($badge)]()<r$RANDOM$RANDOM></coverage-badge>|g" README.md

# - name: Upload README.md
# uses: EndBug/add-and-commit@v9
# with:
# add: ${{ github.workspace }}/README.md

- name: Upload Coverage Badge
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -68,14 +82,12 @@ jobs:
id: check_files
uses: andstor/file-existence-action@v2
with:
files: \
${{ env.APP_NAME }}-coverage-badge.svg,
${{ env.APP_NAME }}-coverage-results.md
files: ${{ env.APP_NAME }}-coverage-badge.svg, ${{ env.APP_NAME }}-coverage-results.md

- name: File exists
if: steps.check_files.outputs.files_exists == 'true'
run: |
rm -f ${{ env.APP_NAME }}-coverage-badge.svg
rm -f ${{ env.APP_NAME }}-coverage-badge.svg ${{ env.APP_NAME }}-coverage-results.md
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
Expand All @@ -86,15 +98,6 @@ jobs:
if: steps.check_files.outputs.files_exists == 'true'
run: ls -al

- name: Commit Change
if: steps.check_files.outputs.files_exists == 'true'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Add changes"
git push
- name: Download Coverage Badge From Artifacts
uses: actions/download-artifact@v3
with:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

![](https://img.shields.io/endpoint?url=https://github.com/cctan777/test-wiki/wiki/test-wiki-coverage-results.md)

[![](https://github.com/cctan777/test-wiki/wiki/test-wiki-coverage-badge.svg)](https://github.com/cctan777/test-wiki/wiki/test-wiki-coverage-results)
[![](https://github.com/cctan777/test-wiki/wiki/test-wiki-coverage-badge.svg)](https://github.com/cctan777/test-wiki/wiki/test-wiki-coverage-results)

<coverage-badge>[![](https://img.shields.io/badge/Code%20Coverage-85%25-success?style=flat)](https://github.com/cctan777/test-wiki/wiki/test-wiki-coverage-results)<r1234></coverage-badge>
2 changes: 1 addition & 1 deletion test-wiki-coverage-results.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Code Coverage](https://img.shields.io/badge/Code%20Coverage-85%25-success?style=flat)
![Code Coverage](https://img.shields.io/badge/Code%20Coverage-86%25-success?style=flat)

Package | Line Rate | Health
-------- | --------- | ------
Expand Down

0 comments on commit a6bdfa3

Please sign in to comment.