Skip to content

Commit 975f6e1

Browse files
committed
feat(ci): configure GitHub App authentication for update-lint-rules workflow
- Add GitHub App token generation for secure authentication - Set up program directory environment variable - Configure custom checkout path for better workspace organization
1 parent c5ac77c commit 975f6e1

File tree

1 file changed

+23
-11
lines changed

1 file changed

+23
-11
lines changed

.github/workflows/update-lint-rules.yaml

+23-11
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,32 @@ jobs:
1313
permissions:
1414
contents: write
1515
pull-requests: write
16+
env:
17+
PROGRAM_DIR: tool/tools/update_lint_rules
1618
steps:
1719
- name: Checkout
1820
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
path: lint
23+
24+
- name: Generate a token
25+
id: app-token
26+
uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
27+
with:
28+
app-id: ${{ secrets.APP_ID_OF_YUMEMI_PR_TOKEN_GENERATOR }}
29+
private-key: ${{ secrets.APP_PRIVATE_KEY_OF_YUMEMI_PR_TOKEN_GENERATOR }}
30+
31+
- name: Checkout
32+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
33+
with:
34+
repository: yumemi-inc/flutter-yumemi-lints-tools
35+
path: tool
1936

2037
- name: Get dvm config
2138
uses: blendfactory/dvm-config-action@acdae6fda79f5a230b5424fdf40fcfd9fcd3367b # v2.0.0
2239
id: dvm-config-action
40+
with:
41+
path: "./tool/.dvm/config.json"
2342

2443
- name: Set up dart
2544
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c # v1.7.1
@@ -29,24 +48,17 @@ jobs:
2948
- name: Install dependencies
3049
run: dart pub get
3150
shell: bash
32-
working-directory: tools/update_lint_rules
51+
working-directory: ${{ env.PROGRAM_DIR }}
3352

3453
- name: Run update_lint_rules
35-
run: dart run bin/update_lint_rules.dart "$GITHUB_WORKSPACE/packages/yumemi_lints/lib"
54+
run: dart run ${{ env.PROGRAM_DIR }}/bin/update_lint_rules.dart ${{ github.workspace }}/lint/lib
3655
shell: bash
37-
working-directory: tools/update_lint_rules
38-
39-
- name: Generate a token
40-
id: generate_token
41-
uses: actions/create-github-app-token@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
42-
with:
43-
app-id: ${{ secrets.APP_ID_OF_YUMEMI_PR_TOKEN_GENERATOR }}
44-
private-key: ${{ secrets.APP_PRIVATE_KEY_OF_YUMEMI_PR_TOKEN_GENERATOR }}
4556

4657
- name: Create a pull request
4758
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
4859
with:
49-
token: ${{ steps.generate_token.outputs.token }}
60+
path: lint
61+
token: ${{ steps.app-token.outputs.token }}
5062
author: 'GitHub <[email protected]>'
5163
commit-message: 'auto: Update lint rules'
5264
title: Update lint rules

0 commit comments

Comments
 (0)