Skip to content

Commit c1b3f1f

Browse files
committed
fix: use kernel-internal GitHub App token in workflows
- Add app token generation step using actions/create-github-app-token@v1 - Replace GITHUB_TOKEN/GH_PAT references with app token - Update git identity to kernel-internal[bot] - Add token to checkout action for fix-ci workflow This aligns with the kernel repo's pattern of using the kernel-internal GitHub App for automated commits and releases.
1 parent b2cf9b0 commit c1b3f1f

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/fix-ci.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,22 @@ permissions:
1313
jobs:
1414
attempt-fix:
1515
if: >-
16-
${{ github.event.workflow_run.conclusion == 'failure' &&
16+
${{ github.event.workflow_run.conclusion == 'failure' &&
1717
github.event.workflow_run.event == 'pull_request' &&
1818
github.event.workflow_run.name != 'Fix CI Failures' }}
1919
runs-on: ubuntu-latest
2020
steps:
21+
- name: Generate app token
22+
id: app-token
23+
uses: actions/create-github-app-token@v1
24+
with:
25+
app-id: ${{ secrets.ADMIN_APP_ID }}
26+
private-key: ${{ secrets.ADMIN_APP_PRIVATE_KEY }}
27+
2128
- name: Checkout repository
2229
uses: actions/checkout@v4
2330
with:
31+
token: ${{ steps.app-token.outputs.token }}
2432
fetch-depth: 0
2533

2634
- name: Install Cursor CLI
@@ -30,8 +38,8 @@ jobs:
3038
3139
- name: Configure git identity
3240
run: |
33-
git config user.name "Cursor Agent"
34-
git config user.email "cursor-agent@onkernel.com"
41+
git config user.name "kernel-internal[bot]"
42+
git config user.email "260533166+kernel-internal[bot]@users.noreply.github.com"
3543
3644
- name: Setup Go
3745
uses: actions/setup-go@v5
@@ -41,7 +49,7 @@ jobs:
4149
- name: Fix CI failure
4250
env:
4351
CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
44-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
4553
BRANCH_PREFIX: ci-fix
4654
run: |
4755
cursor-agent -p "You are operating in a GitHub Actions runner for the Kernel CLI repository.
@@ -79,7 +87,7 @@ jobs:
7987
- Example format:
8088
\"🔧 CI Fix Available
8189
I've pushed a fix for the CI failure.
82-
90+
8391
👉 Click here to create a PR with the fix\"
8492
- Do NOT include any git merge instructions or manual merge commands
8593
- Only include the compare link (e.g., https://github.com/.../compare/...)

.github/workflows/release.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ jobs:
1313
release:
1414
runs-on: ubuntu-latest
1515
steps:
16+
- name: Generate app token
17+
id: app-token
18+
uses: actions/create-github-app-token@v1
19+
with:
20+
app-id: ${{ secrets.ADMIN_APP_ID }}
21+
private-key: ${{ secrets.ADMIN_APP_PRIVATE_KEY }}
22+
1623
- name: Checkout
1724
uses: actions/checkout@v4
1825
with:
@@ -43,5 +50,5 @@ jobs:
4350
version: '~> v2'
4451
args: release --clean
4552
env:
46-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
53+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4754
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

0 commit comments

Comments
 (0)