Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wonda-tea-coffee committed Jun 20, 2024
1 parent e9741bf commit a98fce6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/scripts/token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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}"
8 changes: 8 additions & 0 deletions .github/workflows/zoi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit a98fce6

Please sign in to comment.