Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/translate-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Auto Translate Issues

on:
issue_comment:
types: [created]
issues:
types: [opened]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: dromara/issues-translate-action@v2.7
with:
IS_MODIFY_TITLE: false
Comment on lines +11 to +15

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI 6 months ago

To resolve the issue, explicitly define a permissions block at the workflow level (before jobs:) in .github/workflows/translate-issues.yml. This block should specify least-privilege permissions required for the workflow actions. For this workflow, which automates translation for issues and issue comments, the recommended minimal permissions are issues: write, allowing issue modifications but denying all other repository access by default. Place the permissions key directly beneath name: (line 2), before the on: trigger. No additional imports/methods/definitions are required.

Suggested changeset 1
.github/workflows/translate-issues.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/translate-issues.yml b/.github/workflows/translate-issues.yml
--- a/.github/workflows/translate-issues.yml
+++ b/.github/workflows/translate-issues.yml
@@ -1,4 +1,6 @@
 name: Auto Translate Issues
+permissions:
+  issues: write
 
 on: 
   issue_comment: 
EOF
@@ -1,4 +1,6 @@
name: Auto Translate Issues
permissions:
issues: write

on:
issue_comment:
Copilot is powered by AI and may make mistakes. Always verify output.

Loading