tmp #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: TokenTest | |
| on: | |
| push: | |
| branches: [ token-test ] | |
| pull_request: | |
| branches: [ token-test ] | |
| jobs: | |
| verify_samples: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.TEST_APP_ID }} | |
| private-key: ${{ secrets.TEST_APP_TOKEN }} | |
| owner: JetBrains | |
| repositories: kotlin-web-site,kotlin-compiler-server | |
| permission-contents: write | |
| - name: Check installation access | |
| run: | | |
| echo "=== Repositories accessible by this token ===" | |
| curl -s -H "Authorization: Bearer ${{ steps.app-token.outputs.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| https://api.github.com/installation/repositories | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'JetBrains/kotlin-compiler-server' | |
| - name: Test actual push capability | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| echo "=== Before ===" | |
| git remote -v | |
| git config --unset-all http.https://github.com/.extraheader || true | |
| git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/JetBrains/kotlin-compiler-server.git | |
| echo "=== After ===" | |
| git remote -v | |
| git checkout -b test-app-permissions-${{ github.run_id }} | |
| git commit --allow-empty -m "Test permissions" | |
| git push origin test-app-permissions-${{ github.run_id }} | |
| git push origin --delete test-app-permissions-${{ github.run_id }} |