Skip to content

Commit 23d303b

Browse files
nsheapsclaude
andauthored
refactor(apply-repo-settings): use github-app-auth + accept pre-gener… (#40)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent cd6cad9 commit 23d303b

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

‎.github/actions/apply-repo-settings/action.yml‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ branding:
66
color: 'blue'
77

88
inputs:
9+
token:
10+
description: 'Pre-generated GitHub App installation token. When provided, app-id/private-key are not used for authentication. app-id is still required for substituting the actor_id: -1 placeholder in Integration bypass actors.'
11+
required: false
12+
default: ''
13+
914
app-id:
10-
description: 'GitHub App ID for the applier. Must have Administration:write on the target repo. See docs/setup.html in this action directory for an HTML helper that builds the app via the GitHub manifest flow.'
15+
description: 'GitHub App ID. Required. Used to substitute the actor_id: -1 placeholder in Integration bypass actors. Also used for authentication when token is not provided. See docs/setup.html in this action directory for an HTML helper that builds the app via the GitHub manifest flow.'
1116
required: true
1217

1318
private-key:
14-
description: 'GitHub App private key (PEM).'
15-
required: true
19+
description: 'GitHub App private key (PEM). Required when token is not provided.'
20+
required: false
21+
default: ''
1622

1723
owner:
1824
description: 'Target repo owner. Defaults to the current repo owner.'
@@ -47,14 +53,15 @@ outputs:
4753
runs:
4854
using: 'composite'
4955
steps:
50-
- name: Generate App installation token
56+
- name: Authenticate as GitHub App
5157
id: app-token
52-
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2
58+
if: ${{ inputs.token == '' }}
59+
uses: nsheaps/github-actions/.github/actions/github-app-auth@603052841cd49b9fdc99bc32979ff9c45c9b669e # 2026-05-22
5360
with:
5461
app-id: ${{ inputs.app-id }}
5562
private-key: ${{ inputs.private-key }}
5663
owner: ${{ inputs.owner }}
57-
repositories: ${{ inputs.repo }}
64+
skip-checkout: 'true'
5865

5966
- name: Ensure yq is available
6067
shell: bash
@@ -70,7 +77,7 @@ runs:
7077
id: apply
7178
shell: bash
7279
env:
73-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
80+
GH_TOKEN: ${{ inputs.token || steps.app-token.outputs.token }}
7481
APP_ID: ${{ inputs.app-id }}
7582
OWNER: ${{ inputs.owner }}
7683
REPO: ${{ inputs.repo }}

‎.github/workflows/sync-plugin-specs.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ on:
2626
- cron: '0 6 * * 1'
2727
workflow_dispatch:
2828

29+
permissions: {}
30+
2931
jobs:
3032
sync-specs:
3133
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)