From 58bb8403f930d308dc942d6a58283e68206f0575 Mon Sep 17 00:00:00 2001 From: Piotr Galar Date: Mon, 19 Jun 2023 09:27:08 +0200 Subject: [PATCH 1/2] ci: fix checking state of CI in ipfs-webui --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3caee6bacf1..622e859e628 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -175,11 +175,10 @@ jobs: working-directory: ipfs-webui - id: state env: - GITHUB_REPOSITORY: ipfs/ipfs-webui - GITHUB_REF: ${{ steps.ref.outputs.ref }} GITHUB_TOKEN: ${{ github.token }} - run: | - echo "state=$(curl -L -H "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/commits/$GITHUB_REF/status" --jq '.state')" | tee -a $GITHUB_OUTPUT + ENDPOINT: repos/ipfs/ipfs-webui/commits/${{ steps.ref.outputs.ref }}/status + SELECTOR: .state + run: gh api "$ENDPOINT" --jq "$SELECTOR" | echo "state=" | tee -a $GITHUB_OUTPUT - name: Build ipfs-webui@main (state=${{ steps.state.outputs.state }}) run: npm run test:build working-directory: ipfs-webui From fe76791c6e5f5674ce2e8d973ed946d9f9dfda69 Mon Sep 17 00:00:00 2001 From: Piotr Galar Date: Mon, 19 Jun 2023 10:32:33 +0200 Subject: [PATCH 2/2] ci: fix adding prefix to piped stdout --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 622e859e628..f6a2ced2be1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -178,7 +178,8 @@ jobs: GITHUB_TOKEN: ${{ github.token }} ENDPOINT: repos/ipfs/ipfs-webui/commits/${{ steps.ref.outputs.ref }}/status SELECTOR: .state - run: gh api "$ENDPOINT" --jq "$SELECTOR" | echo "state=" | tee -a $GITHUB_OUTPUT + KEY: state + run: gh api "$ENDPOINT" --jq "$SELECTOR" | xargs -I{} echo "$KEY={}" | tee -a $GITHUB_OUTPUT - name: Build ipfs-webui@main (state=${{ steps.state.outputs.state }}) run: npm run test:build working-directory: ipfs-webui