1
0
mirror of https://github.com/konpa/devicon.git synced 2025-08-19 12:51:43 +02:00

Changed to file read action

This commit is contained in:
Thomas Bui
2021-01-10 20:10:37 -08:00
parent 3d2e655f81
commit 4ea84460cc
2 changed files with 22 additions and 22 deletions

View File

@@ -10,7 +10,6 @@ jobs:
runs-on: ubuntu-18.04
steps:
- name: Check if the trigger run worked. If it failed, fail the current run.
# this is done cause this script should only post the err message if trigger run failed
if: success() && github.event.workflow_run.conclusion != 'success'
uses: cutenode/action-always-fail@v1.0.1
@@ -21,23 +20,23 @@ jobs:
workflow: peek_icons.yml
run_id: ${{ github.event.workflow_run.id }}
- name: Get the PR number and save it in $PR_NUM
- name: Read the pr_num file
if: success()
run: |
echo 'PR_NUM<<EOF' >> $GITHUB_ENV
cat ./pr_num/pr_num.txt >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
id: pr_num_reader
uses: juliangruber/read-file-action@v1.0.0
with:
path: ./pr_num/pr_num.txt
- name: Read the message file
- name: Read the err message file
if: success()
id: message_reader
id: err_message_reader
uses: juliangruber/read-file-action@v1.0.0
with:
path: ./svg_err_messages/svg_err_messages.txt
- name: Comment on the PR about the result - Success
uses: jungwinter/comment@v1 # let us comment on a specific PR
if: success() && steps.message_reader.outputs.content == 'None'
if: success() && steps.err_message_reader.outputs.content == 'None'
env:
MESSAGE: |
Hi!
@@ -49,13 +48,13 @@ jobs:
SVG-Checker Bot :grin:
with:
type: create
issue_number: ${{ env.PR_NUM }}
issue_number: ${{ steps.pr_num_reader.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ env.MESSAGE }}
- name: Comment on the PR about the result - SVG Error
uses: jungwinter/comment@v1 # let us comment on a specific PR
if: success() && steps.message_reader.outputs.content != 'None'
if: success() && steps.err_message_reader.outputs.content != 'None'
env:
MESSAGE: |
Hi!
@@ -77,9 +76,9 @@ jobs:
PS. One day, I will be smart enough to fix these errors for you :persevere:. Until then, I can only point them out.
with:
type: create
issue_number: ${{ env.PR_NUM }}
issue_number: ${{ steps.pr_num_reader.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ format(env.MESSAGE, steps.message_reader.outputs.content) }}
body: ${{ format(env.MESSAGE, steps.err_message_reader.outputs.content) }}
- name: Comment on the PR about the result - Failure
uses: jungwinter/comment@v1 # let us comment on a specific PR
@@ -96,6 +95,6 @@ jobs:
SVG-Checker Bot :smile:
with:
type: create
issue_number: ${{ env.PR_NUM }}
issue_number: ${{ steps.pr_num_reader.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ format(env.MESSAGE, env.SVG_ERR_MSGS)}}
body: ${{ env.MESSAGE }}

View File

@@ -20,11 +20,12 @@ jobs:
workflow: peek_icons.yml
run_id: ${{ github.event.workflow_run.id }}
- name: Get the PR number and save it in $PR_NUM
run: |
echo 'PR_NUM<<EOF' >> $GITHUB_ENV
cat ./pr_num/pr_num.txt >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Read the pr_num file
if: success()
id: pr_num_reader
uses: juliangruber/read-file-action@v1.0.0
with:
path: ./pr_num/pr_num.txt
- name: Upload screenshot of the newly made icons gotten from the artifacts
id: icons_overview_img_step
@@ -68,7 +69,7 @@ jobs:
Peek Bot :blush:
with:
type: create
issue_number: ${{ env.PR_NUM }}
issue_number: ${{ steps.pr_num_reader.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{format(env.MESSAGE, env.OVERVIEW_IMG_MARKDOWN, env.DETAILED_IMGS_MARKDOWN)}}
@@ -93,6 +94,6 @@ jobs:
Peek Bot :relaxed:
with:
type: create
issue_number: ${{ env.PR_NUM }}
issue_number: ${{ steps.pr_num_reader.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ env.MESSAGE }}