Skip to content

Commit

Permalink
ci: use github app token (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeshuaro authored Jan 14, 2024
1 parent f40e02a commit ce28552
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
uses: actions/cache@v3
with:
path: |
${{ env.PUB_CACHE }}
**/.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
Expand Down Expand Up @@ -160,7 +159,6 @@ jobs:
uses: actions/cache@v3
with:
path: |
${{ env.PUB_CACHE }}
**/.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
Expand Down Expand Up @@ -204,6 +202,13 @@ jobs:
build-output: bundle

steps:
- name: Create GitHub App token 🔑
id: create-app-token
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Checkout 🛎️
uses: actions/checkout@v4
with:
Expand All @@ -226,7 +231,6 @@ jobs:
uses: actions/cache@v3
with:
path: |
${{ env.PUB_CACHE }}
**/.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
Expand Down Expand Up @@ -255,7 +259,7 @@ jobs:
shell: bash
run: npx semantic-release --extends ./build.release.config.js
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
GITHUB_TOKEN: ${{ steps.create-app-token.outputs.token }}
APP_TYPE: ${{ matrix.type }}
BUILD_PATH: ${{ matrix.build-path }}
BUILD_OUTPUT: ${{ matrix.build-output }}
Expand All @@ -276,6 +280,13 @@ jobs:
needs: [build]

steps:
- name: Create GitHub App token 🔑
id: create-app-token
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Checkout 🛎️
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -305,4 +316,4 @@ jobs:
- name: Release 🚀
run: npx semantic-release --extends ./publish.release.config.js
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
GITHUB_TOKEN: ${{ steps.create-app-token.outputs.token }}
10 changes: 8 additions & 2 deletions .github/workflows/post-dependency-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Create GitHub App token 🔑
id: create-app-token
uses: tibdex/github-app-token@v2.1.0
with:
app_id: ${{ secrets.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Checkout 🛎️
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
token: ${{ secrets.PAT }}
token: ${{ steps.create-app-token.outputs.token }}

- name: Get project Flutter version 🏷️
id: fvm-config
Expand All @@ -36,7 +43,6 @@ jobs:
uses: actions/cache@v3
with:
path: |
${{ env.PUB_CACHE }}
**/.dart_tool
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
Expand Down

0 comments on commit ce28552

Please sign in to comment.