Skip to content

Commit 9ad8319

Browse files
committed
chore: add GitHub App token creation step to workflows for enhanced security
1 parent a5dc641 commit 9ad8319

5 files changed

+31
-4
lines changed

.github/workflows/android-publish-artifact.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313
publish:
1414
runs-on: ubuntu-latest
1515
steps:
16+
- uses: actions/create-github-app-token@v1
17+
id: app-token
18+
with:
19+
app-id: ${{ secrets.APP_ID }}
20+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
1621
- uses: actions/checkout@v4
1722
- uses: gradle/wrapper-validation-action@v3
1823
- name: set up JDK 17
@@ -26,7 +31,7 @@ jobs:
2631
ref: ${{ github.ref }}
2732
running-workflow-name: android-publish-artifact
2833
check-name: unit
29-
repo-token: ${{ secrets.GITHUB_TOKEN }}
34+
repo-token: ${{ steps.app-token.outputs.token }}
3035
wait-interval: 20
3136
- uses: gradle/actions/setup-gradle@v4
3237
- name: Grant execute permission for gradlew

.github/workflows/android-unit-test.yml

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ jobs:
1717
unit:
1818
runs-on: ubuntu-latest
1919
steps:
20+
- uses: actions/create-github-app-token@v1
21+
id: app-token
22+
with:
23+
app-id: ${{ secrets.APP_ID }}
24+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
2025
- uses: actions/checkout@v4
2126
- uses: gradle/actions/setup-gradle@v4
2227
- name: set up JDK 17
@@ -36,3 +41,4 @@ jobs:
3641
if: always() # always run even if the previous step fails
3742
with:
3843
report_paths: '**/build/test-results/**/TEST-*.xml'
44+
token: ${{ steps.app-token.outputs.token }}

.github/workflows/first-time-contributer-greeting.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ jobs:
99
issues: write
1010
pull-requests: write
1111
steps:
12+
- uses: actions/create-github-app-token@v1
13+
id: app-token
14+
with:
15+
app-id: ${{ secrets.APP_ID }}
16+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
1217
- uses: actions/first-interaction@v1
1318
with:
14-
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
repo-token: ${{ steps.app-token.outputs.token }}
1520
issue-message: "Hey there! Thank you for creating an issue :) Please take a moment to review our [**community guidelines**](https://github.com/AniTrend/android-emojify/blob/develop/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved."
1621
pr-message: "Hey there! Thank you for this PR :) Please take a moment to review our [**community guidelines**](https://github.com/AniTrend/android-emojify/blob/develop/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved."

.github/workflows/gradle-dokka.yml

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ jobs:
1111
gradle-dokka:
1212
runs-on: ubuntu-latest
1313
steps:
14+
- uses: actions/create-github-app-token@v1
15+
id: app-token
16+
with:
17+
app-id: ${{ secrets.APP_ID }}
18+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
1419
- uses: actions/checkout@v4
1520
- name: set up JDK 17
1621
uses: actions/setup-java@v4
@@ -29,3 +34,4 @@ jobs:
2934
with:
3035
branch: docs # The branch the action should deploy to.
3136
folder: dokka-docs # The folder the action should deploy.
37+
token: ${{ steps.app-token.outputs.token }}

.github/workflows/release-drafter.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,22 @@ jobs:
1818
pull-requests: write
1919
runs-on: ubuntu-latest
2020
steps:
21+
- uses: actions/create-github-app-token@v1
22+
id: app-token
23+
with:
24+
app-id: ${{ secrets.APP_ID }}
25+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
2126
- uses: release-drafter/release-drafter@v6
2227
id: release_drafter
2328
with:
2429
config-name: release-drafter-config.yml
2530
disable-autolabeler: false
2631
commitish: develop
2732
env:
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
2934
- name: Repository Dispatch
3035
uses: peter-evans/repository-dispatch@v3
3136
with:
32-
token: ${{ secrets.GITHUB_TOKEN }}
37+
token: ${{ steps.app-token.outputs.token }}
3338
event-type: version-update-and-push
3439
client-payload: '{"version": "${{ steps.release_drafter.outputs.resolved_version }}"}'

0 commit comments

Comments
 (0)