Skip to content

Commit

Permalink
ci: use bot as git user
Browse files Browse the repository at this point in the history
Signed-off-by: Lachlan Heywood <[email protected]>
  • Loading branch information
lachieh committed Jan 14, 2025
1 parent ba7c151 commit 77c43ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
3 changes: 0 additions & 3 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 77c43ac

Please sign in to comment.