Skip to content

Commit ecf3b23

Browse files
committed
try the app
1 parent 8ca726f commit ecf3b23

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/discussions.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,16 @@ jobs:
3131
- name: Check out code
3232
uses: actions/checkout@v5
3333

34+
- name: Generate token from GitHub App
35+
id: generate_token
36+
uses: actions/create-github-app-token@v1
37+
with:
38+
app-id: ${{ secrets.APP_ID }}
39+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
40+
3441
- name: Fetch and process stale discussions
3542
env:
36-
GH_TOKEN: ${{ secrets.DISCUSSION_TOKEN }}
43+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
3744
STALE_DAYS: ${{ env.STALE_DAYS }}
3845
WARNING_DAYS: ${{ env.WARNING_DAYS }}
3946
WARNING_MESSAGE: ${{ env.WARNING_MESSAGE }}
@@ -42,7 +49,7 @@ jobs:
4249
GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }}
4350
run: |
4451
if [ -z "$GH_TOKEN" ]; then
45-
echo "ERROR: GH_TOKEN is not set. Make sure the DISCUSSION_TOKEN secret is configured."
52+
echo "ERROR: GH_TOKEN is not set. Make sure the GitHub App is configured correctly."
4653
exit 1
4754
fi
4855
echo "GH_TOKEN is set (length: ${#GH_TOKEN})"

0 commit comments

Comments
 (0)