test: verify GitHub App commit shows as Verified #2
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: Test App commit verification | |
| on: | |
| push: | |
| branches: | |
| - suever/use-app-token-for-openapi-commits/devrel-144 | |
| permissions: | |
| contents: write | |
| jobs: | |
| test-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ vars.MASSIVE_CLIENT_LIBRARY_AUTOMATION_APP_ID }} | |
| private-key: ${{ secrets.MASSIVE_CLIENT_LIBRARY_AUTOMATION_APP_PRIVATE_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| persist-credentials: true | |
| - name: Get GitHub App bot identity | |
| id: bot-identity | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| APP_SLUG: ${{ steps.app-token.outputs.app-slug }} | |
| run: | | |
| user_id=$(gh api "/users/${APP_SLUG}[bot]" --jq .id) | |
| echo "name=${APP_SLUG}[bot]" >> "$GITHUB_OUTPUT" | |
| echo "email=${user_id}+${APP_SLUG}[bot]@users.noreply.github.com" >> "$GITHUB_OUTPUT" | |
| - name: Make test commit | |
| run: | | |
| git config user.name "${{ steps.bot-identity.outputs.name }}" | |
| git config user.email "${{ steps.bot-identity.outputs.email }}" | |
| echo "# Test commit — safe to delete" > .test-app-commit | |
| git add .test-app-commit | |
| git commit -m "test: verify GitHub App commit shows as Verified" | |
| git push |