Skip to content

Commit 54a9ae8

Browse files
committed
chore: testing permission of github app
1 parent b24950f commit 54a9ae8

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: test_app_permissions.yaml
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
test-permissions:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Generate GitHub App Token
10+
id: app-token
11+
uses: actions/create-github-app-token@v1
12+
with:
13+
app-id: ${{ secrets.GARDENER_GITHUB_WORKFLOW_PKG_MNGR_APP_ID }}
14+
private-key: ${{ secrets.GARDENER_GITHUB_WORKFLOW_PKG_MNGR_APP_PRIVATE_KEY }}
15+
16+
- name: Test commit permissions to pr-preview repo
17+
run: |
18+
git config --global user.name "github-actions[bot]"
19+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
20+
21+
# Clone the repository using the app token
22+
git clone https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/klocke-io/pr-preview.git
23+
cd pr-preview
24+
25+
# Create a test file
26+
echo "Test commit at $(date)" > test-commit-permissions.txt
27+
28+
# Attempt to commit and push
29+
git add test-commit-permissions.txt
30+
git commit -m "Test: Verify GitHub App token commit permissions"
31+
git push origin main || git push origin master
32+
33+
echo "✅ Successfully committed to klocke-io/pr-preview repository"

0 commit comments

Comments
 (0)