@devries-cameron20 / composio Mirror · read-only / commits / 1e55f0a52
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 17:15 UTC

ci(docs): open docs PRs with the release-bot app token

`GITHUB_TOKEN` cannot create pull requests in this repository: the "Allow GitHub Actions to create and approve pull requests" setting is disabled, so `createPullRequest` is rejected regardless of what the job's `pull-requests` permission grants. `docs.changelog-to-docs.yml` has failed at `gh pr create` on every run with docs changes since that setting was flipped, leaving pushed branches behind with no PR. `docs.sync-connect-clients.yml` had the same defect latently: its `create-pull-request` action passed no `token`, so it fell back to `github.token`. Both now mint a release-bot App token, matching every other PR-opening workflow in the repo, and check out with it so pushes are authored by the app and PR CI triggers. Also split the reviewer request out of `gh pr create` into a separate best-effort step. An unassignable actor previously failed the whole command after the branch was already pushed, which is what turned each failure into an orphaned branch.

jkomyno committed Aug 5, 2026 at 22:38 UTC 1e55f0a52ede7e2783717448bd8f19f4cf3ebaef
2 files changed +46 -5
.github/workflows/docs.changelog-to-docs.yml
+34 -4
@@ -17,11 +17,25 @@ jobs:
17 permissions:
18 contents: write
19 pull-requests: write
20 + id-token: write
21
22 steps:
23 + # `GITHUB_TOKEN` cannot open pull requests here: the repository has
24 + # "Allow GitHub Actions to create and approve pull requests" disabled, so
25 + # `createPullRequest` is rejected no matter what `pull-requests` grants.
26 + # Every other PR-opening workflow in this repo mints a release-bot App
27 + # token for exactly this reason.
28 + - name: Generate GitHub App token
29 + id: app-token
30 + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
31 + with:
32 + client-id: ${{ vars.RELEASE_BOT_CLIENT_ID }}
33 + private-key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }}
34 +
35 - name: Checkout repository
36 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
37 with:
38 + token: ${{ steps.app-token.outputs.token }}
39 fetch-depth: 0
40
41 - name: Detect new changelog files
@@ -62,9 +76,10 @@ jobs:
76 5. If no docs changes are needed, make no file changes and explain why
77
78 - name: Create PR if docs changed
79 + id: create-pr
80 if: steps.detect.outputs.found == 'true'
81 env:
67 - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82 + GH_TOKEN: ${{ steps.app-token.outputs.token }}
83 run: |
84 if [ -z "$(git status --porcelain)" ]; then
85 echo "No documentation changes needed"
@@ -79,15 +94,30 @@ jobs:
94 git commit -m "docs: update documentation for new changelog entries"
95 git push -u origin "$BRANCH"
96
82 - gh pr create \
97 + # Requesting the reviewer is deliberately NOT part of this call: an
98 + # unassignable actor (bot account, non-collaborator) would fail the
99 + # whole command after the branch is already pushed, leaving an orphan
100 + # branch and no PR. It runs as a separate best-effort step below.
101 + PR_URL=$(gh pr create \
102 --base next \
103 --head "$BRANCH" \
104 --title "docs: update documentation for new changelog entries" \
86 - --reviewer "$GITHUB_ACTOR" \
105 --body "$(cat <<'EOF'
106 ## Summary
107 Automated documentation updates triggered by new changelog entries merged to next.
108
109 Generated by Codex via GitHub Actions.
110 EOF
93 - )"
111 + )")
112 +
113 + echo "$PR_URL"
114 + echo "pull-request-number=$(basename "$PR_URL")" >> "$GITHUB_OUTPUT"
115 +
116 + - name: Request review from pusher
117 + if: steps.create-pr.outputs.pull-request-number
118 + continue-on-error: true
119 + env:
120 + GH_TOKEN: ${{ steps.app-token.outputs.token }}
121 + PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }}
122 + AUTHOR: ${{ github.actor }}
123 + run: gh pr edit "$PR_NUMBER" --add-reviewer "$AUTHOR"
.github/workflows/docs.sync-connect-clients.yml
+12 -1
@@ -18,9 +18,19 @@ jobs:
18 id-token: write
19
20 steps:
21 + # See docs.changelog-to-docs.yml: `GITHUB_TOKEN` cannot open pull requests
22 + # in this repository, so the PR step below needs a release-bot App token.
23 + - name: Generate GitHub App token
24 + id: app-token
25 + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
26 + with:
27 + client-id: ${{ vars.RELEASE_BOT_CLIENT_ID }}
28 + private-key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }}
29 +
30 - name: Checkout repository
31 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
32 with:
33 + token: ${{ steps.app-token.outputs.token }}
34 ref: next
35 fetch-depth: 1
36
@@ -71,6 +81,7 @@ jobs:
81 id: create-pr
82 uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
83 with:
84 + token: ${{ steps.app-token.outputs.token }}
85 commit-message: 'docs: sync Connect clients from dashboard'
86 title: 'docs: sync Connect clients from dashboard'
87 body: |
@@ -95,7 +106,7 @@ jobs:
106 - name: Request review from trigger actor
107 if: steps.create-pr.outputs.pull-request-number
108 env:
98 - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109 + GH_TOKEN: ${{ steps.app-token.outputs.token }}
110 PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }}
111 AUTHOR: ${{ github.actor }}
112 run: gh pr edit "$PR_NUMBER" --add-reviewer "$AUTHOR"