Skip to content

fix: some fixes#59

Merged
titanxxh merged 1 commit intomainfrom
fix/some-issues
Oct 10, 2025
Merged

fix: some fixes#59
titanxxh merged 1 commit intomainfrom
fix/some-issues

Conversation

@titanxxh
Copy link
Copy Markdown
Collaborator

@titanxxh titanxxh commented Oct 10, 2025

What type of PR is this?

perf: change to dirt make
fix: remove empty slice
chore: use syscall in x/sys/unix
ci: change golint

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
zh(optional):

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Oct 10, 2025

CLA assistant check
All committers have signed the CLA.

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium test

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: {contents: read}

Copilot Autofix

AI 6 months ago

The best way to fix this problem is to add an explicit permissions block to the workflow file. Since none of the jobs in the provided YAML require elevated or write permissions for the GITHUB_TOKEN (all actions are reading code or reporting coverage via a script), the minimal permission set can be contents: read. This should be placed at the top level of the workflow to apply to all jobs, unless any job requires elevated permissions (which, in the shown snippet, none does). You would add the block just after the workflow name (e.g., after line 1 or 2), before specifying the on field.


Suggested changeset 1
.github/workflows/tests.yaml

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/tests.yaml b/.github/workflows/tests.yaml
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -1,4 +1,6 @@
 name: Tests
+permissions:
+  contents: read
 
 on: [ push, pull_request ]
 
EOF
@@ -1,4 +1,6 @@
name: Tests
permissions:
contents: read

on: [ push, pull_request ]

Copilot is powered by AI and may make mistakes. Always verify output.
@titanxxh titanxxh force-pushed the fix/some-issues branch 3 times, most recently from 2c8482d to 5ef3b26 Compare October 10, 2025 10:35
Comment on lines 7 to 24
@@ -16,29 +16,18 @@ jobs:
- name: Check Spell
uses: crate-ci/typos@v1.13.14

staticcheck:
runs-on: [ self-hosted, X64 ]
# 用一个新的、更强大的 linter 作业替换 staticcheck
linter:
runs-on: [ self-hosted, X64, Linux ]
steps:
- uses: actions/checkout@v3
- name: Set up Go

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: {contents: read}

Copilot Autofix

AI 6 months ago

To fix the problem, you should add a permissions block to the workflow to restrict the GITHUB_TOKEN permissions used by default. The block can be added at the root of the workflow (recommended for this case), which applies to all jobs unless overridden. The minimal starting point suggested by CodeQL is contents: read, which is appropriate because the jobs only need to check out code and run analysis—they do not need to write to the repository or interact with issues/pull requests. Specifically, insert the following block after the name and before on:

permissions:
  contents: read

No further code or dependency changes are required.


Suggested changeset 1
.github/workflows/pre_check.yaml

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/pre_check.yaml b/.github/workflows/pre_check.yaml
--- a/.github/workflows/pre_check.yaml
+++ b/.github/workflows/pre_check.yaml
@@ -1,4 +1,6 @@
 name: Pull Request Check
+permissions:
+  contents: read
 
 on: [ pull_request ]
 
EOF
@@ -1,4 +1,6 @@
name: Pull Request Check
permissions:
contents: read

on: [ pull_request ]

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

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: {contents: read}

Copilot Autofix

AI 6 months ago

To fix the detected issue, add an explicit permissions block scoped as tightly as necessary. The best place is at the root level of the workflow file (i.e., directly under the name and before on or jobs). This default will apply to all jobs in the workflow unless overridden. Since all jobs in this workflow are performing read-only checks, the minimal required permission is contents: read.

Steps:

  • Insert a permissions: block with the appropriate permissions.
  • Place it directly after the name: declaration and before on:.
  • No further changes to workflow steps or jobs are necessary.

Suggested changeset 1
.github/workflows/pre_check.yaml

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/pre_check.yaml b/.github/workflows/pre_check.yaml
--- a/.github/workflows/pre_check.yaml
+++ b/.github/workflows/pre_check.yaml
@@ -1,4 +1,6 @@
 name: Pull Request Check
+permissions:
+  contents: read
 
 on: [ pull_request ]
 
EOF
@@ -1,4 +1,6 @@
name: Pull Request Check
permissions:
contents: read

on: [ pull_request ]

Copilot is powered by AI and may make mistakes. Always verify output.
@titanxxh titanxxh force-pushed the fix/some-issues branch 5 times, most recently from 1c441b7 to b92494b Compare October 10, 2025 11:08
perf: change to dirt make
fix: remove empty slice
chore: use syscall in x/sys/unix
ci: change golint
@titanxxh titanxxh merged commit 75d4376 into main Oct 10, 2025
20 checks passed
@GuangmingLuo GuangmingLuo deleted the fix/some-issues branch October 11, 2025 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants