-
Notifications
You must be signed in to change notification settings - Fork 0
Automate support-article-update skill #39
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Silverfin UK support-article update | ||
| run-name: Sync Notion support articles for merged PR #${{ inputs.pr_number }} | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| pr_number: | ||
| description: "Number of the merged PR in the calling repo" | ||
| required: true | ||
| type: number | ||
| merge_sha: | ||
| description: "Merge commit SHA of the PR" | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| update-support-articles: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ inputs.merge_sha }} | ||
|
|
||
| - uses: anthropics/claude-code-action@v1 | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| display_report: true | ||
| plugins: bso-cursor-rules | ||
| plugin_marketplaces: https://github.com/silverfin/bso-cursor-rules.git | ||
| prompt: | | ||
| A PR just merged into main on this repo: PR #${{ inputs.pr_number }} | ||
| (merge commit ${{ inputs.merge_sha }}). | ||
|
|
||
| Invoke the skill bso-cursor-rules:silverfin-uk-support-article-update | ||
| for this merged PR, unattended. Pass the PR as its number/URL per the | ||
| skill's own instructions. Do not stop to ask questions or wait for | ||
| input — follow the skill's unattended/hard rules exactly, and produce | ||
| the final handoff report as your last message. | ||
| claude_args: | | ||
| --mcp-config '{"mcpServers":{"notion":{"command":"npx","args":["-y","@notionhq/notion-mcp-server"],"env":{"NOTION_TOKEN":"${{ secrets.NOTION_TOKEN }}"}}}}' | ||
| --allowedTools "Bash(gh pr view*),Bash(gh api*),Bash(git show*),Read,Grep,Glob,WebFetch,Skill,mcp__notion__notion-fetch,mcp__notion__notion-query-data-sources,mcp__notion__notion-query-database-view,mcp__notion__notion-update-page,mcp__notion__notion-create-comment" | ||
|
Comment on lines
+24
to
+48
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 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- workflow files ---'
git ls-files '.github/workflows/silverfin_uk_support_article_update.yml' '.github/workflows' | sed -n '1,120p'
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/silverfin_uk_support_article_update.yml
printf '%s\n' '--- dependency references ---'
rg -n --hidden --glob '!node_modules' --glob '!dist' \
'anthropics/claude-code-action|actions/checkout|plugin_marketplaces|`@notionhq/notion-mcp-server`|mcp-config|fetch-depth|bso-cursor-rules' .
printf '%s\n' '--- repository metadata ---'
git status --short
git remote -v | sed -n '1,20p'Repository: silverfin/bso_github_actions Length of output: 6659 🏁 Script executed: #!/bin/bash
set -eu
api() {
curl --fail --silent --show-error \
-H 'Accept: application/vnd.github+json' \
-H 'User-Agent: review-verifier' "$1"
}
printf '%s\n' '--- marketplace repository metadata ---'
api 'https://api.github.com/repos/silverfin/bso-cursor-rules' |
jq '{default_branch, archived, pushed_at, html_url}'
printf '%s\n' '--- marketplace default-branch ref ---'
branch="$(api 'https://api.github.com/repos/silverfin/bso-cursor-rules' | jq -r '.default_branch')"
api "https://api.github.com/repos/silverfin/bso-cursor-rules/git/ref/heads/$branch" |
jq '{ref, object}'
printf '%s\n' '--- package metadata ---'
curl --fail --silent --show-error \
-H 'Accept: application/json' \
'https://registry.npmjs.org/@notionhq%2fnotion-mcp-server' |
jq '{dist_tags: .["dist-tags"], latest_version: .["dist-tags"].latest, latest_tarball: .versions[.["dist-tags"].latest].dist.tarball}'
printf '%s\n' '--- source references to plugin marketplace documentation ---'
rg -n --hidden --glob '!node_modules' --glob '!dist' \
'plugin_marketplaces|bso-cursor-rules|notion-mcp-server' \
.github README.md 2>/dev/null || trueRepository: silverfin/bso_github_actions Length of output: 1269 🌐 Web query:
💡 Result: In Claude Code, the configuration for plugin marketplaces and plugins supports version pinning using a Citations:
🌐 Web query:
💡 Result: When you run npx without specifying a version, it does not strictly resolve to the latest dist-tag. Instead, npm's resolution logic prioritizes compatibility with your current Node.js runtime environment based on the package's engines field [1][2]. The resolution behavior is as follows: 1. Compatibility Prioritization: Since mid-2024, npm prioritizes versions whose engines field matches your installed Node.js version [1]. If the version pointed to by the latest dist-tag is incompatible with your Node.js runtime, npm will automatically search for the newest version that satisfies your environment's requirements instead [1][2]. 2. Pre-existing Installations: If the requested package is already available in your local project's node_modules or in your system's PATH, npx will use that existing version rather than fetching a new one [3][4][5]. This prevents npx from unnecessarily updating packages that are already present in your environment [6][5]. 3. Registry Interaction: When the package is not found locally, npx fetches the package from the registry. While it generally aims to provide the latest appropriate version, the inclusion of engine constraints means the resolved version may be older than the official latest tag if that newer version is incompatible with your machine's Node.js version [1][2]. If you explicitly require the latest version regardless of engine compatibility or local installation status, you should use the Citations:
🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- marketplace refs ---'
git ls-remote --heads --tags https://github.com/silverfin/bso-cursor-rules.git 2>&1 |
sed -n '1,80p'
printf '%s\n' '--- Claude Code action metadata ---'
curl --fail --silent --show-error \
-L 'https://raw.githubusercontent.com/anthropics/claude-code-action/main/action.yml' |
sed -n '1,180p'
printf '%s\n' '--- Claude Code action documentation references ---'
curl --fail --silent --show-error \
-L 'https://raw.githubusercontent.com/anthropics/claude-code-action/main/README.md' |
rg -n -C 4 'plugin_marketplaces|plugins|mcp-config|allowedTools' |Repository: silverfin/bso_github_actions Length of output: 10285 🌐 Web query:
💡 Result: GitHub strongly recommends pinning third-party actions to a full-length (40-character) commit SHA to ensure security and stability [1][2][3]. This practice makes the action reference immutable, meaning the workflow will always execute the exact code you reviewed and approved, regardless of any upstream changes to tags or branches [1][4][5][6]. Key points regarding this practice: Security and Immutability: Pinning to a full-length SHA is the only way to treat an action as an immutable release [1][3]. While version tags (e.g., Citations:
🌐 Web query:
💡 Result: In Claude Code, the terms ref and sha are used to manage version control and pinning for git-based plugin marketplaces [1]. When configuring a git-based marketplace—such as those using the github, url, or git-subdir source types—you can use the following parameters to target specific versions [1]: - ref: Specifies a git branch or tag (defaults to the repository's default branch if omitted) [1]. - sha: Specifies the full 40-character git commit SHA to pin the plugin to an exact version [1]. If both ref and sha are provided, the sha is treated as the effective pin, and Claude Code will fetch and check out that specific commit [1]. In the context of the Claude Code GitHub Action, the plugin_marketplaces input accepts a newline-separated list of Git repository URLs [2][3]. While you specify the URL in the action input, standard Claude Code marketplace syntax allows you to append these versioning qualifiers to the source definition (e.g., using Citations:
🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- Claude Code marketplace documentation ---'
curl --fail --silent --show-error -L \
'https://code.claude.com/docs/en/plugin-marketplaces' |
tr '\r\n' ' ' |
sed 's/<[^>]*>/ /g' |
sed 's/[[:space:]]\+/ /g' |
rg -o -i '.{0,260}(ref|sha|git|github|marketplace add).{0,360}' |
sed -n '1,40p'
printf '%s\n' '--- Claude Code GitHub Actions documentation ---'
curl --fail --silent --show-error -L \
'https://code.claude.com/docs/en/github-actions' |
tr '\r\n' ' ' |
sed 's/<[^>]*>/ /g' |
sed 's/[[:space:]]\+/ /g' |
rg -o -i '.{0,220}(plugin_marketplaces|marketplace|claude_args).{0,360}' |
sed -n '1,40p'Repository: silverfin/bso_github_actions Length of output: 39833 Pin action and plugin dependencies to immutable versions.
Claude Code does not support a SHA for the marketplace source itself, so use only its supported fixed ref there. 🧰 Tools🪛 zizmor (1.29.0)[warning] 24-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) 🤖 Prompt for AI Agents |
||
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: silverfin/bso_github_actions
Length of output: 25029
🌐 Web query:
actions/checkout default fetch-depth 1 merge commit parent history git show documentation💡 Result:
The actions/checkout action has a default fetch-depth of 1, which performs a shallow clone by fetching only the single commit that triggered the workflow [1][2]. Key aspects of this default behavior include: 1. Limited History: Because only one commit is fetched, the local Git repository will not contain the parent history of that commit [1][3]. Attempting to access parent commits or perform operations that require the commit graph (like certain git log or merge-base commands) will fail unless you increase the fetch-depth [3][4]. 2. Merge Commit Default: For pull request events, the default reference (ref) checked out by actions/checkout is a generated test merge commit (the PR merged into the base branch) [4][5]. This is done to test the PR changes in the context of the base branch [5]. 3. Impact on Git Operations: If you require full access to commit history, tags, or the ability to determine common ancestors (e.g., for calculating diffs or semantic versioning), you must explicitly configure the action [6][4]: - To fetch all history (including all branches and tags), set fetch-depth: 0 [1][7]. - To fetch a specific number of commits (e.g., to support merging or finding merge-bases), set fetch-depth to an appropriate integer (e.g., 2 or more) [1][3][4]. - If tags are required but you do not need the full commit history, you can set fetch-tags: true [2][8]. In summary, the default fetch-depth: 1 is an optimization for performance and speed, assuming you only need to work with the files at the specific ref that triggered the build [6][5]. For workflows requiring deeper Git knowledge, you must override these defaults in your workflow YAML configuration [1][6].
Citations:
fetch-depth: 1and not cloning tags are dangerous defaults actions/checkout#217Fetch the merge parents before running the skill.
The default
fetch-depth: 1does not provide the merge commit’s parent history.git show*cannot reliably calculate the merged PR diff without those parent objects. Setfetch-depth: 0.Proposed fix
- uses: actions/checkout@v4 with: ref: ${{ inputs.merge_sha }} + fetch-depth: 0📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.29.0)
[warning] 24-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents