-
Notifications
You must be signed in to change notification settings - Fork 1
Update 8hobbies/workflows digest to aeea4ef #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| jobs: | ||
| lint: | ||
| uses: 8hobbies/workflows/.github/workflows/npm-lint.yml@6ffa892638c05b08601b32c5baa4bbf9a858b620 | ||
| uses: 8hobbies/workflows/.github/workflows/npm-lint.yml@aeea4ef82ae99732c467d6245294bbed0e0fa426 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix this issue, we need to add a permissions block specifying the minimum required permissions for the workflow at the root level of .github/workflows/lint.yml. Since the workflow only calls a reusable workflow to lint code (which typically only requires read access to repository contents), we can start with the recommended minimal configuration:
permissions:
contents: readThis block should be placed directly under the name: key (line 13) but before the on: key (line 15) for clarity and convention.
-
Copy modified lines R14-R15
| @@ -11,6 +11,8 @@ | ||
| # OF THIS SOFTWARE. | ||
|
|
||
| name: Lint | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: |
| jobs: | ||
| run: | ||
| uses: 8hobbies/workflows/.github/workflows/npm-publish-dry-run.yml@6ffa892638c05b08601b32c5baa4bbf9a858b620 | ||
| uses: 8hobbies/workflows/.github/workflows/npm-publish-dry-run.yml@aeea4ef82ae99732c467d6245294bbed0e0fa426 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix the problem, we should add an explicit permissions block at the root of the workflow configuration (top-level, right below name:), which will apply to all jobs (unless they override it). Since this workflow is running a dry-run publish and there are no clues in the provided snippet about any tokens requiring special privileges, the safest general default is permissions: contents: read. This will allow the workflow to clone/fetch code, but not to push code, create releases, or do anything with escalated privileges. If, after further inspection, more permissions (such as packages: write) are needed, they can be added later; but starting with the most restrictive set is safest.
To implement this, insert the following code after the name: declaration:
permissions:
contents: readThis should occur right above the on: block, e.g., on line 14 or 15.
-
Copy modified lines R14-R15
| @@ -11,6 +11,8 @@ | ||
| # OF THIS SOFTWARE. | ||
|
|
||
| name: Publish Dry Run | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: |
| jobs: | ||
| test: | ||
| uses: 8hobbies/workflows/.github/workflows/npm-runtime.yml@6ffa892638c05b08601b32c5baa4bbf9a858b620 | ||
| uses: 8hobbies/workflows/.github/workflows/npm-runtime.yml@aeea4ef82ae99732c467d6245294bbed0e0fa426 |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 3 months ago
To fix this problem, add a permissions: block to the workflow, so that jobs triggered by this workflow do not inherit broad default permissions. The block should be placed at the root level (between name:/on: and jobs:), unless individual jobs require tailored permissions (in which case those jobs would declare them explicitly). As a starting point, set contents: read, which is the recommended minimal permission for most workflows. If a job requires more (such as pull-requests: write), add only those specific permissions. In this case, as the job is simply using a reusable workflow and there is no evidence of a need for write permissions, set contents: read at the root level in .github/workflows/runtime.yml, after the name: and before the on: section.
-
Copy modified lines R15-R17
| @@ -12,6 +12,9 @@ | ||
|
|
||
| name: Runtime | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["master"] |
This PR contains the following updates:
6ffa892->aeea4efConfiguration
📅 Schedule: Branch creation - "on Sunday" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.