Skip to content

Standardize Claude GitHub Action workflow#43

Merged
chriscalo merged 1 commit into
mainfrom
claude/standardize-claude-action-workflow
May 26, 2026
Merged

Standardize Claude GitHub Action workflow#43
chriscalo merged 1 commit into
mainfrom
claude/standardize-claude-action-workflow

Conversation

@chriscalo

Copy link
Copy Markdown
Owner

Adds (or replaces) .github/workflows/claude.yaml with the
canonical workflow from
chriscalo/dev-skills.

Tool policy: --allowedTools "Read,Grep,Glob,Edit,Write,Skill,Task,Agent,Bash(*),WebFetch,WebSearch"
with a targeted --disallowedTools list. See
claude-action.md "Tool policy"
for rationale.

Future drift can be detected via
sync-claude-action.sh audit OWNER/REPO.

Adds (or replaces) .github/workflows/claude.yaml with the canonical
workflow from chriscalo/dev-skills:skills/github/claude-action-workflow.yaml.

Tool policy: --allowedTools "Read,Grep,Glob,Edit,Write,Skill,Task,Agent,Bash(*),WebFetch,WebSearch"
with a targeted --disallowedTools list (force-push, push-to-main, branch/repo/
release delete, mutating gh api, npm publish, gh secret/auth ops). See
chriscalo/dev-skills:skills/github/claude-action.md section 'Tool policy'
for rationale.
Copilot AI review requested due to automatic review settings May 26, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces/updates .github/workflows/claude.yaml to match a canonical “Claude” GitHub Action workflow, aiming to standardize event handling, editor-only gating, and the agent tool policy.

Changes:

  • Splits the workflow into a gate job (editor permission check) and a claude job that only runs when the actor is confirmed to be an editor.
  • Adds an upload-image helper installation step intended to enable embedding images in GitHub markdown via an R2-backed upload.
  • Expands the Claude tool policy (--allowedTools / --disallowedTools) to include additional tool categories and tighter git-push restrictions.
Comments suppressed due to low confidence (1)

.github/workflows/claude.yaml:56

  • The gh api permission check treats any API error as perm=none (2>/dev/null || echo "none"), which can silently disable the workflow for everyone if github.token lacks the permissions required by repos/.../collaborators/<user>/permission (or if the API call fails for transient reasons). It would be safer to (1) explicitly declare the minimal permissions: needed for this gate job, and (2) distinguish "not a collaborator" from "API/auth failure" so misconfiguration doesn’t look like a normal skip.
        run: |
          actor="${{ github.actor }}"
          perm=$(gh api \
            "repos/${{ github.repository }}/collaborators/$actor/permission" \
            --jq '.permission' 2>/dev/null || echo "none")

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +103 to +107
creds_file="$RUNNER_TEMP/.upload-image-creds"
if [ -n "${R2_ACCOUNT_ID:-}" ] \
&& [ -n "${R2_ACCESS_KEY_ID:-}" ] \
&& [ -n "${R2_SECRET_ACCESS_KEY:-}" ]; then
umask 077
@chriscalo chriscalo merged commit af13846 into main May 26, 2026
2 of 3 checks passed
@chriscalo chriscalo deleted the claude/standardize-claude-action-workflow branch May 26, 2026 10:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6cee6d589d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +109 to +113
printf 'AWS_ACCESS_KEY_ID=%q\n' "$R2_ACCESS_KEY_ID"
printf 'AWS_SECRET_ACCESS_KEY=%q\n' "$R2_SECRET_ACCESS_KEY"
printf 'AWS_DEFAULT_REGION=auto\n'
printf 'R2_ACCOUNT_ID=%q\n' "$R2_ACCOUNT_ID"
} > "$creds_file"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid persisting R2 secrets where Claude can read them

This step writes long-lived R2 credentials to $RUNNER_TEMP/.upload-image-creds and later runs anthropics/claude-code-action in the same job, where Claude is allowed to execute arbitrary Bash(*). File mode 600 does not protect against this because subsequent steps run as the same runner user, so a prompt-injected run can still cat the creds file and exfiltrate cloud keys in comments/logs. This is a new secret-exposure path introduced by the helper and should be removed or isolated from the Claude execution context.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants