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