From a98fce6d6530fd819c7a189ababb92f242ebffaf Mon Sep 17 00:00:00 2001 From: wonda-tea-coffee Date: Thu, 20 Jun 2024 13:24:48 +0900 Subject: [PATCH] fix --- .github/scripts/token.sh | 3 +++ .github/workflows/zoi.yml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/scripts/token.sh b/.github/scripts/token.sh index 530711b..68a7ab0 100755 --- a/.github/scripts/token.sh +++ b/.github/scripts/token.sh @@ -16,7 +16,9 @@ exp="$((now + (3 * 60)))" template='{"iss":"%s","iat":%s,"exp":%s}' payload="$(printf "${template}" "${APP_ID}" "${iat}" "${exp}" | base64url)" signature="$(printf '%s' "${header}.${payload}" | sign | base64url)" +echo "::add-mask::${signature}" jwt="${header}.${payload}.${signature}" +echo "::add-mask::${jwt}" # Installation APIの実行 repo="wonda-tea-coffee/${TARGET_REPO}" @@ -37,4 +39,5 @@ token="$(curl --location --silent --request POST \ --data "$(printf '{"repositories":["%s"]}' "${TARGET_REPO}")" \ | jq -r '.token' )" +echo "::add-mask::${token}" echo "token=${token}" >>"${GITHUB_OUTPUT}" diff --git a/.github/workflows/zoi.yml b/.github/workflows/zoi.yml index 1d07397..b6c466d 100644 --- a/.github/workflows/zoi.yml +++ b/.github/workflows/zoi.yml @@ -18,3 +18,11 @@ jobs: path: ${{ env.TARGET_REPO }} token: ${{ steps.create.outputs.token }} - run: cat "${TARGET_REPO}/README.md" + - run: | + curl --location --silent --request DELETE \ + --url "${GITHUB_API_URL}/installation/token" \ + --header "Accept: application/vnd.github+json" \ + --header "X-GitHub-Api-Version: 2022-11-28" \ + --header "Authorization: Bearer ${TOKEN}" + env: + TOKEN: ${{ steps.create.outputs.token }}