Repository navigation
Release v0.5.0 #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release v0.5.0 #29
Changes from all commits
299aa87
78525b3
f853428
3afdc31
5e157da
12eab07
d7868f9
2590284
b6395da
9f48ab9
4e29ba9
32239c6
dd1e63b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,25 @@ | ||
| # Example environment for the Cominty SDK. | ||
| # | ||
| # The SDK reads these from the real process environment. It does NOT auto-load | ||
| # .env — either export them, or load this file yourself, e.g.: | ||
| # .env: either export them, or load this file yourself, e.g.: | ||
| # set -a; source .env; set +a # shell | ||
| # from dotenv import load_dotenv; load_dotenv() # python-dotenv (not a dependency) | ||
|
|
||
| # Your API key (required). Create one at https://platform.cominty.ai/api-keys | ||
| COMINTY_API_KEY= | ||
|
|
||
| # End-user identifier (required) — the user every request acts on behalf of. | ||
| # End-user identifier (required): the user every request acts on behalf of. | ||
| # Looks like user_xxxxxxxxxxxxxxxxxxxxxxxx. Find yours at | ||
| # https://platform.cominty.ai -> avatar (top right) -> Profile | ||
| COMINTY_USER_ID= | ||
|
|
||
| # --- Optional ------------------------------------------------------------ | ||
| # Override the API base URL (default: https://ds.cominty.com). | ||
| # dev -> https://ds-dev.cominty.com | ||
| # COMINTY_BASE_URL=https://ds-dev.cominty.com | ||
| # staging -> https://ds-staging.cominty.com | ||
| # COMINTY_BASE_URL=https://ds-staging.cominty.com | ||
|
|
||
| # Used only by the example scripts (the SDK itself has no agent default). | ||
| # Find agent ids at https://platform.cominty.ai/agents | ||
| # COMINTY_AGENT_ID=__cominty_agents::agent.chat | ||
| # A custom agent you created on the platform — used by 07_custom_agent.py | ||
| # A custom agent you created on the platform, used by 07_custom_agent.py | ||
| # COMINTY_CUSTOM_AGENT_ID= |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,30 @@ | ||||||||||||
| # This is to address https://github.com/orgs/community/discussions/5524 | ||||||||||||
| name: Fast Forward Merge | ||||||||||||
| on: | ||||||||||||
| issue_comment: | ||||||||||||
| types: [created] | ||||||||||||
|
|
||||||||||||
| jobs: | ||||||||||||
| merge: | ||||||||||||
| name: Fast Forward | ||||||||||||
| if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/merge') | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
gh api repos/cominty/fast-forward-js-action/contents/ --jq '.[].name'
gh api repos/cominty/fast-forward-js-action/git/trees/d2e1f31b37078f9f1be14aa4b6ca7dca1b1544c2?recursive=1 --jq '.tree[].path' | head -50Repository: cominty/python-sdk Length of output: 2098 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- PR diff ---'
git diff --no-ext-diff --unified=40 3a537df653bf2087e3ca6132770bd8a2fac92f68 dd1e63b00f0c8f20768c448324d53a72b7429aef -- .github/workflows/merge.yml
printf '%s\n' '--- workflow at reviewed head ---'
git show dd1e63b00f0c8f20768c448324d53a72b7429aef:.github/workflows/merge.yml | nl -ba
printf '%s\n' '--- pinned action source files ---'
gh api 'repos/cominty/fast-forward-js-action/git/trees/d2e1f31b37078f9f1be14aa4b6ca7dca1b1544c2?recursive=1' --jq '.tree[].path | select(startswith("src/") or . == "action.yml")'
printf '%s\n' '--- pinned action manifest ---'
gh api 'repos/cominty/fast-forward-js-action/contents/action.yml?ref=d2e1f31b37078f9f1be14aa4b6ca7dca1b1544c2' --jq '.content' | base64 -d | nl -ba
printf '%s\n' '--- source candidates ---'
for path in src/fast_forward_action.ts src/fast_forward_action.js src/index.ts src/index.js src/fast_forward_action.ts; do
if gh api "repos/cominty/fast-forward-js-action/contents/$path?ref=d2e1f31b37078f9f1be14aa4b6ca7dca1b1544c2" --jq -e '.content' >/tmp/action-source.b64 2>/dev/null; then
printf '%s\n' "--- $path ---"
base64 -d /tmp/action-source.b64 | nl -ba
fi
doneRepository: cominty/python-sdk Length of output: 5704 🏁 Script executed: #!/bin/bash
set -e
for path in src/index.ts src/fast_forward_action.ts src/github_client_wrapper.ts; do
echo "--- $path ---"
gh api -H 'Accept: application/vnd.github.raw+json' "repos/cominty/fast-forward-js-action/contents/$path?ref=d2e1f31b37078f9f1be14aa4b6ca7dca1b1544c2" | nl -ba
done
echo "--- bundled implementation authorization references ---"
gh api -H 'Accept: application/vnd.github.raw+json' "repos/cominty/fast-forward-js-action/contents/dist/fast_forward_action.js?ref=d2e1f31b37078f9f1be14aa4b6ca7dca1b1544c2" | rg -n -i 'author|association|permission|collaborator|merge|pull' | head -80Repository: cominty/python-sdk Length of output: 10344 Restrict The workflow runs for any PR comment containing Require a trusted author association and a command prefix: 🔒️ Suggested fix--- "a/.github/workflows/merge.yml"
+++ "b/.github/workflows/merge.yml"
@@ -7,7 +7,10 @@
jobs:
merge:
name: Fast Forward
- if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/merge')
+ if: >-
+ github.event.issue.pull_request != '' &&
+ startsWith(github.event.comment.body, '/merge') &&
+ contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
runs-on: ubuntu-latest
steps:
- name: Checkout code📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.30.1)[warning] 8-31: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) 🤖 Prompt for AI AgentsSources: Learnings, Linters/SAST tools |
||||||||||||
| runs-on: ubuntu-latest | ||||||||||||
| steps: | ||||||||||||
| - name: Checkout code | ||||||||||||
| uses: actions/checkout@v4 | ||||||||||||
|
|
||||||||||||
| - name: Fast Forward PR | ||||||||||||
| uses: cominty/fast-forward-js-action@d2e1f31b37078f9f1be14aa4b6ca7dca1b1544c2 | ||||||||||||
| with: | ||||||||||||
| # We use a PAT so pushing the fast-forwarded commits to main still | ||||||||||||
| # triggers ci.yml (the GITHUB_TOKEN's own pushes never re-trigger | ||||||||||||
| # workflows). /merge-no-deploy fast-forwards without that PAT, so | ||||||||||||
| # it does not re-trigger anything. | ||||||||||||
| # Links: | ||||||||||||
| # - https://github.com/endre-spotlab/fast-forward-js-action/issues/36#issuecomment-1493006429 | ||||||||||||
| # - https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow | ||||||||||||
| GITHUB_TOKEN: ${{ contains(github.event.comment.body, '/merge-no-deploy') && secrets.GITHUB_TOKEN || secrets.FAST_FORWARD_MERGE_PAT }} | ||||||||||||
| success_message: "Success! Fast forwarded ***target_base*** to ***source_head***! ```git checkout target_base && git merge source_head --ff-only```" | ||||||||||||
| failure_message: "Failed! Cannot do fast forward!" | ||||||||||||
| status_name: fast-forward-merge | ||||||||||||
| update_status: true | ||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,6 @@ build/ | |
| .ruff_cache/ | ||
| .pytest_cache/ | ||
| .env | ||
| .coverage | ||
| .coverage.* | ||
| htmlcov/ | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Declare a read-only
permissionsblock for the workflow.The workflow has no
permissions:block, so the defaultGITHUB_TOKENscopes apply. Thetestjob only checks out code and runs local commands. Writing to$GITHUB_STEP_SUMMARYdoes not need any token scope. Restrict the token tocontents: read.🔒️ Proposed fix
on: push: branches: [main, dev] pull_request: branches: [main, dev] + +permissions: + contents: read🧰 Tools
🪛 zizmor (1.30.1)
[warning] 10-43: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 Prompt for AI Agents
Sources: Learnings, Linters/SAST tools