From 77c43ac7f478c9b4a145c7104a0ae4d430e97408 Mon Sep 17 00:00:00 2001 From: Lachlan Heywood Date: Tue, 14 Jan 2025 16:22:25 -0500 Subject: [PATCH] ci: use bot as git user Signed-off-by: Lachlan Heywood --- .github/workflows/ci_release.yml | 15 ++++++++++++++- packages/eslint-config/package.json | 3 --- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_release.yml b/.github/workflows/ci_release.yml index 8f9b13b..8dc4fa7 100644 --- a/.github/workflows/ci_release.yml +++ b/.github/workflows/ci_release.yml @@ -43,13 +43,25 @@ jobs: - name: Build run: yarn build - - name: meta + - name: Get App Token id: app-token uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 with: app-id: ${{ secrets.BOT_APP_ID }} private-key: ${{ secrets.BOT_APP_PRIVATE_KEY }} + - name: Get GitHub App User ID + id: get-user-id + run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + + - name: Configure git as App User + run: | + git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]' + git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>' + git config --global format.signOff true + - name: Version or Publish id: changesets uses: changesets/action@c8bada60c408975afd1a20b3db81d6eee6789308 @@ -58,6 +70,7 @@ jobs: commit: 'chore: update versions' version: yarn ci:version publish: yarn ci:publish + setupGitUser: false env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index c5ca862..37c6cfe 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -3,9 +3,6 @@ "version": "0.0.0", "private": true, "license": "MIT", - "publishConfig": { - "access": "public" - }, "devDependencies": { "@types/node": "^20.17.12", "typescript": "^5.7.3"