mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-21 07:40:11 +08:00
ci(claude-translator): add github_token to workflow for authentication (#10053)
* ci(claude-translator): add github_token to workflow for authentication * ci(workflows): restrict code review to main repo PRs Fix OIDC issues by only triggering reviews for PRs from the main repository * ci(workflows): re-enable issues trigger for claude translator The upstream bug has been fixed, so we can now re-enable the issues trigger. Also update the claude-code-action to use main branch instead of v1 tag.
This commit is contained in:
parent
0c589a6f79
commit
493b0d4a11
9
.github/workflows/claude-code-review.yml
vendored
9
.github/workflows/claude-code-review.yml
vendored
@ -12,12 +12,9 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
claude-review:
|
claude-review:
|
||||||
# Optional: Filter by PR author
|
# Only trigger code review for PRs from the main repository due to upstream OIDC issues
|
||||||
# if: |
|
# https://github.com/anthropics/claude-code-action/issues/542
|
||||||
# github.event.pull_request.user.login == 'external-contributor' ||
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||||
# github.event.pull_request.user.login == 'new-developer' ||
|
|
||||||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
12
.github/workflows/claude-translator.yml
vendored
12
.github/workflows/claude-translator.yml
vendored
@ -4,18 +4,15 @@ concurrency:
|
|||||||
cancel-in-progress: false
|
cancel-in-progress: false
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# temporally disable this because upstream bug.
|
issues:
|
||||||
# issues:
|
types: [opened]
|
||||||
# types: [opened]
|
|
||||||
issue_comment:
|
issue_comment:
|
||||||
types: [created, edited]
|
types: [created, edited]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
translate:
|
translate:
|
||||||
# disable issues for now because upstream bug
|
|
||||||
# (github.event_name == 'issues' && github.event.issue.author_association == 'COLLABORATOR' && !contains(github.event.issue.body, 'This issue was translated by Claude.')) ||
|
|
||||||
|
|
||||||
if: |
|
if: |
|
||||||
|
(github.event_name == 'issues') ||
|
||||||
(github.event_name == 'issue_comment' && github.event.sender.type != 'Bot') &&
|
(github.event_name == 'issue_comment' && github.event.sender.type != 'Bot') &&
|
||||||
((github.event_name == 'issue_comment' && github.event.action == 'created' && !contains(github.event.comment.body, 'This issue was translated by Claude')) ||
|
((github.event_name == 'issue_comment' && github.event.action == 'created' && !contains(github.event.comment.body, 'This issue was translated by Claude')) ||
|
||||||
(github.event_name == 'issue_comment' && github.event.action == 'edited'))
|
(github.event_name == 'issue_comment' && github.event.action == 'edited'))
|
||||||
@ -33,9 +30,10 @@ jobs:
|
|||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Run Claude for translation
|
- name: Run Claude for translation
|
||||||
uses: anthropics/claude-code-action@v1
|
uses: anthropics/claude-code-action@main
|
||||||
id: claude
|
id: claude
|
||||||
with:
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
claude_args: '--allowed-tools Bash(gh issue:*),Bash(gh api:repos/*/issues:*)'
|
claude_args: '--allowed-tools Bash(gh issue:*),Bash(gh api:repos/*/issues:*)'
|
||||||
prompt: |
|
prompt: |
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user