From 063f11e79d0b7dd116bb6e6f23685a3a15c6faa3 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Wed, 18 Dec 2024 16:27:50 +0900 Subject: [PATCH] chore: new token workflow for worker-deploy.yml --- .github/workflows/worker-deploy.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/worker-deploy.yml b/.github/workflows/worker-deploy.yml index b86ae0d..9936c48 100644 --- a/.github/workflows/worker-deploy.yml +++ b/.github/workflows/worker-deploy.yml @@ -89,12 +89,18 @@ jobs: env: GH_TOKEN: ${{ steps.app-token.outputs.token }} - - run: | + - name: 'Set GitHub user' + run: | APP_SLUG="${{ steps.app-token.outputs.app-slug || 'github-actions' }}" - USER_ID="${{ steps.get-user-id.outputs.user-id || 'github-actions' }}" - - git config --global user.name "${APP_SLUG}[bot]" - git config --global user.email "${USER_ID}+${APP_SLUG}[bot]@users.noreply.github.com" + USER_ID="${{ steps.get-user-id.outputs.user-id || '' }}" + + if [ -z "$USER_ID" ]; then + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + else + git config --global user.name "${APP_SLUG}[bot]" + git config --global user.email "${USER_ID}+${APP_SLUG}[bot]@users.noreply.github.com" + fi - name: Format manifest.json using Prettier shell: bash