From bba71f838904d84b35452c0537d7c5328f0e370c Mon Sep 17 00:00:00 2001 From: Joe DeStefano Date: Tue, 29 Aug 2023 10:25:53 -0700 Subject: [PATCH 1/5] fix: forgot to add new input to action.yml --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 34dd37f..a4ce089 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,9 @@ inputs: description: AWS Region required: false default: us-west-2 + github_token: + description: Repo token for fetching commit details + required: false runs: using: "node16" main: "dist/index.js" From dd0fa8923b7d816720eaca60e942c75e25c10784 Mon Sep 17 00:00:00 2001 From: Joe DeStefano Date: Tue, 29 Aug 2023 10:36:56 -0700 Subject: [PATCH 2/5] fix: Fix test workflow to not error if grep fails --- .github/workflows/test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bc90fa2..4244e01 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,10 +24,10 @@ jobs: - name: Check for diff id: diff run: | - git status -s dist/ | grep "dist/" - echo "GIT_STATUS=$?" >> "$GITHUB_OUTPUT" + git status -s dist/ | grep "dist/" || echo "SHOULD_PUSH_BUILD=false" >> "$GITHUB_OUTPUT + echo "SHOULD_PUSH_BUILD=true" >> "$GITHUB_OUTPUT" - name: Push build - if: ${{ steps.diff.outputs.GIT_STATUS == '0' }} + if: ${{ steps.diff.outputs.SHOULD_PUSH_BUILD == 'true' }} run: | git config user.name github-actions git config user.email github-actions@github.com From 9e43082d9a27f2e0857240573116701ee2e3e198 Mon Sep 17 00:00:00 2001 From: Joe DeStefano Date: Tue, 29 Aug 2023 10:40:38 -0700 Subject: [PATCH 3/5] fix: just use an if statement --- .github/workflows/test.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4244e01..b2567f8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,8 +24,12 @@ jobs: - name: Check for diff id: diff run: | - git status -s dist/ | grep "dist/" || echo "SHOULD_PUSH_BUILD=false" >> "$GITHUB_OUTPUT - echo "SHOULD_PUSH_BUILD=true" >> "$GITHUB_OUTPUT" + if [ git status -s dist/ | grep "dist/" ]; then + echo "SHOULD_PUSH_BUILD=true" >> "$GITHUB_OUTPUT" + else + echo "SHOULD_PUSH_BUILD=false" >> "$GITHUB_OUTPUT" + fi + - name: Push build if: ${{ steps.diff.outputs.SHOULD_PUSH_BUILD == 'true' }} run: | From 29002db31c4ad9da85f88e087760d6ae1e904da7 Mon Sep 17 00:00:00 2001 From: Joe DeStefano Date: Tue, 29 Aug 2023 10:47:56 -0700 Subject: [PATCH 4/5] fix: Remove [] operator from if statement --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b2567f8..981b44e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,7 +24,7 @@ jobs: - name: Check for diff id: diff run: | - if [ git status -s dist/ | grep "dist/" ]; then + if git status -s dist/ | grep "dist/"); then echo "SHOULD_PUSH_BUILD=true" >> "$GITHUB_OUTPUT" else echo "SHOULD_PUSH_BUILD=false" >> "$GITHUB_OUTPUT" From 8fd1d82ac6a6d15102b3bb850dcb70dcb01e53c9 Mon Sep 17 00:00:00 2001 From: Joe DeStefano Date: Tue, 29 Aug 2023 10:50:09 -0700 Subject: [PATCH 5/5] fix: forgot the end parenthesis --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 981b44e..939b183 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -24,7 +24,7 @@ jobs: - name: Check for diff id: diff run: | - if git status -s dist/ | grep "dist/"); then + if git status -s dist/ | grep "dist/"; then echo "SHOULD_PUSH_BUILD=true" >> "$GITHUB_OUTPUT" else echo "SHOULD_PUSH_BUILD=false" >> "$GITHUB_OUTPUT"