From 59456b8138bd368821cf27fc3a0782753b9279ca Mon Sep 17 00:00:00 2001 From: Eric Schneider <37347760+eric-schneider@users.noreply.github.com> Date: Thu, 19 Nov 2026 10:05:09 -0600 Subject: [PATCH] Start drafts with the Docs GitHub App's token GitHub blocks every personal access token in the riptano and datastax organizations from 19 November 2026, 4 PM Pacific. This workflow starts the draft build in riptano/datastax-docs-site with DOC_GITHUB_PAT_CROSS_ORG, one of those tokens. Get a short-lived token from the Docs GitHub App instead, with actions/create-github-app-token. The token is limited to GitHub Actions in riptano/datastax-docs-site, where it starts the draft build and follows it. The App's client ID and private key come from organization variables and secrets: DOCS_APP_RIPTANO_CLIENT_ID and DOCS_APP_RIPTANO_PRIVATE_KEY where each organization has its own App, otherwise DOCS_APP_CLIENT_ID and DOCS_APP_PRIVATE_KEY. --- .github/workflows/dispatch-deploy-draft.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dispatch-deploy-draft.yml b/.github/workflows/dispatch-deploy-draft.yml index 5a134ea..6f2adac 100644 --- a/.github/workflows/dispatch-deploy-draft.yml +++ b/.github/workflows/dispatch-deploy-draft.yml @@ -10,11 +10,23 @@ jobs: runs-on: ubuntu-latest steps: + - name: Get GitHub App Token + id: app_token + uses: actions/create-github-app-token@v3.3.0 + with: + # The Docs GitHub App: one App for both organizations (DOCS_APP_*), + # or one per organization (DOCS_APP_RIPTANO_* for riptano's). + client-id: ${{ vars.DOCS_APP_RIPTANO_CLIENT_ID || vars.DOCS_APP_CLIENT_ID }} + private-key: ${{ secrets.DOCS_APP_RIPTANO_PRIVATE_KEY || secrets.DOCS_APP_PRIVATE_KEY }} + owner: riptano + repositories: datastax-docs-site + permission-actions: write + - name: Deploy Draft uses: convictional/trigger-workflow-and-wait@v1.6.5 with: owner: riptano repo: datastax-docs-site - github_token: ${{ secrets.DOC_GITHUB_PAT_CROSS_ORG }} + github_token: ${{ steps.app_token.outputs.token }} workflow_file_name: deploy-draft.yml client_payload: '{ "build_repository": "${{ github.event.repository.full_name }}", "build_branch": "${{ github.base_ref }}", "draft_branch": "${{ github.event.pull_request.head.ref }}", "pull_request_number": "${{ github.event.pull_request.number }}" }'