Skip to content

Conversation

@sbreitbart-NOAA
Copy link
Collaborator

@sbreitbart-NOAA sbreitbart-NOAA commented Dec 29, 2025

Identical to nmfs-ost/asar#407

@github-actions
Copy link
Contributor

New version checklist

  • Package version in DESCRIPTION has been updated
  • Release notes have been drafted/published
  • Cheatsheet content has been updated (if applicable)
  • Cheatsheet version has been updated

Comment on lines +10 to +30
runs-on: ubuntu-latest
name: new-version-checklist
steps:
- name: Checkout
uses: actions/checkout@v3
- name: 'Comment PR'
uses: actions/github-script@0.3.0
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var msg = `# New version checklist

- [ ] Package version in DESCRIPTION has been updated
- [ ] Release notes have been drafted/published
- [ ] Cheatsheet content has been updated (if applicable)
- [ ] Cheatsheet version has been updated

`
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
github.issues.createComment({ issue_number, owner, repo, body: msg });

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 1 day ago

To fix this, add an explicit permissions block that limits the GITHUB_TOKEN to only what this workflow actually needs. The only GitHub API operation performed is github.issues.createComment, which requires issues: write. The checkout step can run with contents: read. The best fix is to add a permissions block inside the new-version-checklist job so the scope is limited just to this job, without affecting other workflows.

Concretely, in .github/workflows/new-version-checklist.yml, under jobs: new-version-checklist: and at the same indentation level as runs-on, insert:

    permissions:
      contents: read
      issues: write

No additional imports or methods are required; this is purely a configuration change to the workflow file and preserves existing functionality while constraining token permissions.

Suggested changeset 1
.github/workflows/new-version-checklist.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/new-version-checklist.yml b/.github/workflows/new-version-checklist.yml
--- a/.github/workflows/new-version-checklist.yml
+++ b/.github/workflows/new-version-checklist.yml
@@ -8,6 +8,9 @@
 jobs:
   new-version-checklist:
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      issues: write
     name: new-version-checklist
     steps:
       - name: Checkout
EOF
@@ -8,6 +8,9 @@
jobs:
new-version-checklist:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
name: new-version-checklist
steps:
- name: Checkout
Copilot is powered by AI and may make mistakes. Always verify output.
@sbreitbart-NOAA sbreitbart-NOAA marked this pull request as ready for review December 29, 2025 20:14
@github-actions
Copy link
Contributor

Code Metrics Report

Coverage Code to Test Ratio Test Execution Time
70.6% 1:0.2 58s

Reported by octocov

@sbreitbart-NOAA sbreitbart-NOAA merged commit b179b7c into main Dec 30, 2025
10 checks passed
@sbreitbart-NOAA sbreitbart-NOAA deleted the new-vers-checklist branch December 30, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants