Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Fix prompt shell expansion in codespell workflow (#70290)

mendral-app[bot]52ae8a14db43
diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml
index e768149c439..d9b715695bf 100644
--- a/.github/workflows/codespell.yml
+++ b/.github/workflows/codespell.yml
@@ -43,27 +43,35 @@ jobs:
app-id: ${{ secrets.METABASE_BOT_APP_ID }}
private-key: ${{ secrets.METABASE_BOT_APP_PRIVATE_KEY }}
+ - name: Build Claude prompt
+ if: steps.codespell_check.outcome == 'failure'
+ run: |
+ cat > /tmp/claude_prompt.txt << 'PROMPT_HEADER'
+ You are tasked with fixing spelling errors detected by codespell in this repository.
+
+ ## Codespell Output
+ The following spelling errors were detected:
+ ```
+ PROMPT_HEADER
+ cat codespell_output.txt >> /tmp/claude_prompt.txt
+ cat >> /tmp/claude_prompt.txt << 'PROMPT_FOOTER'
+ ```
+
+ ## Instructions
+ 1. **Review the codespell output and identify reported spelling errors** - The usual format codespell uses is `typo ==> correction`
+ 2. **Fix every spelling error** - Use the Edit tool to fix each misspelling with the suggested correction
+ - If codespell suggests multiple corrections, choose the most appropriate one based on context
+
+ Human reviewers will verify the changes before merging, so fix all errors reported by codespell.
+ PROMPT_FOOTER
+
- name: Fix spelling errors with Claude Code
if: steps.codespell_check.outcome == 'failure'
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ steps.claude-app-token.outputs.token }}
- prompt: |
- You are tasked with fixing spelling errors detected by codespell in this repository.
-
- ## Codespell Output
- The following spelling errors were detected:
- ```
- $(cat codespell_output.txt)
- ```
-
- ## Instructions
- 1. **Review the codespell output and identify reported spelling errors** - The usual format codespell uses is `typo ==> correction`
- 2. **Fix every spelling error** - Use the Edit tool to fix each misspelling with the suggested correction
- - If codespell suggests multiple corrections, choose the most appropriate one based on context
-
- Human reviewers will verify the changes before merging, so fix all errors reported by codespell.
+ prompt_file: /tmp/claude_prompt.txt
claude_args: |
--allowedTools "Write,Read,Glob,Grep,Edit,MultiEdit,Bash(cat*),Bash(ls*)"
--disallowedTools "Bash(git commit*),Bash(git push*),Bash(gh*)"