From 4ea84460cc5737fd4f3880555dbc854a394d647d Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Sun, 10 Jan 2021 20:10:37 -0800 Subject: [PATCH] Changed to file read action --- .github/workflows/post_check_svgs_comment.yml | 29 +++++++++---------- .github/workflows/post_peek_screenshot.yml | 15 +++++----- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/post_check_svgs_comment.yml b/.github/workflows/post_check_svgs_comment.yml index b7d71220..a94f7593 100644 --- a/.github/workflows/post_check_svgs_comment.yml +++ b/.github/workflows/post_check_svgs_comment.yml @@ -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<> $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 }} diff --git a/.github/workflows/post_peek_screenshot.yml b/.github/workflows/post_peek_screenshot.yml index d39bce47..44bda66a 100644 --- a/.github/workflows/post_peek_screenshot.yml +++ b/.github/workflows/post_peek_screenshot.yml @@ -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<> $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 }}