From 6ef44983900e2a90a4606457a6fd4f3eefff0088 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 7 Mar 2025 08:12:40 +0900 Subject: [PATCH 01/10] test From d086423f7322d9a2f7f3ab3475f9403c29acf04e Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 7 Mar 2025 08:17:47 +0900 Subject: [PATCH 02/10] update --- .github/workflows/test.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 776acba0..ea416a13 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,5 +2,12 @@ name: test on: pull_request jobs: - status-check: + test: uses: ./.github/workflows/wc-test.yaml + status-check: + runs-on: ubuntu-24.04 + if: failure() + needs: + - test + steps: + - run: exit 1 From 512efc6151f32a5e2bffd4e525e7defa71207071 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 7 Mar 2025 09:11:05 +0900 Subject: [PATCH 03/10] update --- .github/workflows/wc-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wc-test.yaml b/.github/workflows/wc-test.yaml index 81cb55c7..bb6b7752 100644 --- a/.github/workflows/wc-test.yaml +++ b/.github/workflows/wc-test.yaml @@ -5,7 +5,7 @@ jobs: foo: runs-on: ubuntu-24.04 steps: - - run: test -n "$TEST_ENV" + - run: sleep 60 env: TEST_ENV: ${{vars.TEST_ENV}} bar: From 718aa0641419f7b71a1753da82be74a1003cda0c Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 7 Mar 2025 12:51:44 +0900 Subject: [PATCH 04/10] update --- .github/workflows/test.yaml | 53 ++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ea416a13..c17efbdb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,12 +2,57 @@ name: test on: pull_request jobs: - test: - uses: ./.github/workflows/wc-test.yaml + # test: + # uses: ./.github/workflows/wc-test.yaml status-check: runs-on: ubuntu-24.04 if: failure() - needs: - - test + # needs: + # - test steps: - run: exit 1 + after-status-check: + runs-on: ubuntu-24.04 + if: always() + permissions: + statuses: write + needs: + - status-check + steps: + - name: Create a check run (success) + env: + GH_TOKEN: ${{ github.token }} + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "/repos/$GITHUB_REPOSITORY/check-runs" \ + -f "name=status-check" \ + -f "head_sha=$GITHUB_SHA" \ + -f "status=completed" \ + -f "conclusion=success" + - name: Create a commit status (failure) + env: + GH_TOKEN: ${{github.token}} + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + -f "state=failure" \ + -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + -f "context=status-check" + - name: Create a commit status (success) + env: + GH_TOKEN: ${{github.token}} + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + -f "state=success" \ + -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + -f "context=status-check" From c64a54cd0e595c47026f01559aac1891b50ba5dc Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 7 Mar 2025 12:52:50 +0900 Subject: [PATCH 05/10] fix --- .github/workflows/test.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c17efbdb..95125680 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,6 +16,7 @@ jobs: if: always() permissions: statuses: write + checks: write needs: - status-check steps: From d708e5a09a12c0e95507efdd20d444da1d09d5f9 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 7 Mar 2025 12:54:46 +0900 Subject: [PATCH 06/10] fix --- .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 95125680..fd1fcae7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,7 +6,7 @@ jobs: # uses: ./.github/workflows/wc-test.yaml status-check: runs-on: ubuntu-24.04 - if: failure() + # if: failure() # needs: # - test steps: From 0ffbd36d68a016a4a906f267e0b408ff8a55e75e Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 7 Mar 2025 12:56:34 +0900 Subject: [PATCH 07/10] update --- .github/workflows/test.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fd1fcae7..c6ae1947 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -57,3 +57,15 @@ jobs: -f "state=success" \ -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ -f "context=status-check" + - name: Create a commit status (success) + env: + GH_TOKEN: ${{github.token}} + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + -f "state=success" \ + -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + -f "context=test / status-check" From a460d4288f026bf9be119b356f2f139cdadb7dc8 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 7 Mar 2025 12:57:28 +0900 Subject: [PATCH 08/10] update --- .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 c6ae1947..7ac1a6d2 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -68,4 +68,4 @@ jobs: "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ -f "state=success" \ -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ - -f "context=test / status-check" + -f "context=test / status-check (pull_request)" From 244837c7074977ab405035fb5f883461c6151b1f Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 7 Mar 2025 12:58:44 +0900 Subject: [PATCH 09/10] fix --- .github/workflows/test.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7ac1a6d2..92d9eca0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -33,6 +33,19 @@ jobs: -f "head_sha=$GITHUB_SHA" \ -f "status=completed" \ -f "conclusion=success" + - name: Create a check run (success) + env: + GH_TOKEN: ${{ github.token }} + run: | + gh api \ + --method POST \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "/repos/$GITHUB_REPOSITORY/check-runs" \ + -f "name=test / status-check (pull_request)" \ + -f "head_sha=$GITHUB_SHA" \ + -f "status=completed" \ + -f "conclusion=success" - name: Create a commit status (failure) env: GH_TOKEN: ${{github.token}} From dacad4f164e5fec4fedf1fb3074f60b23253c109 Mon Sep 17 00:00:00 2001 From: Shunsuke Suzuki Date: Fri, 7 Mar 2025 13:17:11 +0900 Subject: [PATCH 10/10] test --- .github/workflows/foo.yaml | 8 ++ .github/workflows/test.yaml | 155 +++++++++++++++++++----------------- 2 files changed, 92 insertions(+), 71 deletions(-) create mode 100644 .github/workflows/foo.yaml diff --git a/.github/workflows/foo.yaml b/.github/workflows/foo.yaml new file mode 100644 index 00000000..4a6b172e --- /dev/null +++ b/.github/workflows/foo.yaml @@ -0,0 +1,8 @@ +--- +name: foo +on: pull_request +jobs: + status-check: + runs-on: ubuntu-24.04 + steps: + - run: exit 0 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 92d9eca0..85ecf916 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,74 +11,87 @@ jobs: # - test steps: - run: exit 1 - after-status-check: - runs-on: ubuntu-24.04 - if: always() - permissions: - statuses: write - checks: write - needs: - - status-check - steps: - - name: Create a check run (success) - env: - GH_TOKEN: ${{ github.token }} - run: | - gh api \ - --method POST \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "/repos/$GITHUB_REPOSITORY/check-runs" \ - -f "name=status-check" \ - -f "head_sha=$GITHUB_SHA" \ - -f "status=completed" \ - -f "conclusion=success" - - name: Create a check run (success) - env: - GH_TOKEN: ${{ github.token }} - run: | - gh api \ - --method POST \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "/repos/$GITHUB_REPOSITORY/check-runs" \ - -f "name=test / status-check (pull_request)" \ - -f "head_sha=$GITHUB_SHA" \ - -f "status=completed" \ - -f "conclusion=success" - - name: Create a commit status (failure) - env: - GH_TOKEN: ${{github.token}} - run: | - gh api \ - --method POST \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ - -f "state=failure" \ - -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ - -f "context=status-check" - - name: Create a commit status (success) - env: - GH_TOKEN: ${{github.token}} - run: | - gh api \ - --method POST \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ - -f "state=success" \ - -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ - -f "context=status-check" - - name: Create a commit status (success) - env: - GH_TOKEN: ${{github.token}} - run: | - gh api \ - --method POST \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ - -f "state=success" \ - -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ - -f "context=test / status-check (pull_request)" + # after-status-check: + # runs-on: ubuntu-24.04 + # if: always() + # permissions: + # statuses: write + # checks: write + # needs: + # - status-check + # steps: + # - name: Create a check run (success) + # env: + # GH_TOKEN: ${{ github.token }} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/check-runs" \ + # -f "name=status-check" \ + # -f "head_sha=$GITHUB_SHA" \ + # -f "status=completed" \ + # -f "conclusion=success" + # - name: Create a check run (success) + # env: + # GH_TOKEN: ${{ github.token }} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/check-runs" \ + # -f "name=test / status-check (pull_request)" \ + # -f "head_sha=$GITHUB_SHA" \ + # -f "status=completed" \ + # -f "conclusion=success" + # - name: Update a check run (success) + # env: + # GH_TOKEN: ${{ github.token }} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/check-runs" \ + # -f "name=test / status-check (pull_request)" \ + # -f "head_sha=$GITHUB_SHA" \ + # -f "status=completed" \ + # -f "conclusion=success" + # - name: Create a commit status (failure) + # env: + # GH_TOKEN: ${{github.token}} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + # -f "state=failure" \ + # -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + # -f "context=status-check" + # - name: Create a commit status (success) + # env: + # GH_TOKEN: ${{github.token}} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + # -f "state=success" \ + # -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + # -f "context=status-check" + # - name: Create a commit status (success) + # env: + # GH_TOKEN: ${{github.token}} + # run: | + # gh api \ + # --method POST \ + # -H "Accept: application/vnd.github+json" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # "/repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + # -f "state=success" \ + # -f "target_url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + # -f "context=test / status-check (pull_request)"