Skip to content

Conversation

@maximiliani
Copy link
Member

Potential fix for https://github.com/kit-data-manager/pid-component/security/code-scanning/21

To fix the issue, we need to add a permissions block to the workflow. Since the workflow only performs basic CI tasks (installing dependencies and running builds), it requires minimal permissions. The contents: read permission is sufficient for these operations. The permissions block should be added at the root level of the workflow to apply to all jobs.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

maximiliani and others added 5 commits June 5, 2025 09:38
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…in permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@maximiliani maximiliani marked this pull request as ready for review June 5, 2025 08:00
@maximiliani maximiliani requested a review from Copilot June 5, 2025 08:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds minimal permissions blocks to several GitHub Actions workflows to satisfy a code-scanning alert and consolidates outdated publish workflows.

  • Introduces a unified publish.yml with root-level and job-level permissions for contents and packages.
  • Adds permissions: contents: read to the npm-ci.yml workflow.
  • Removes the obsolete real-npm-publish.yml and github-npm-publish.yml workflows.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.github/workflows/publish.yml New combined publish workflow with minimal permissions
.github/workflows/npm-ci.yml Added permissions: contents: read block to existing CI job
.github/workflows/real-npm-publish.yml Removed outdated npm publish workflow
.github/workflows/github-npm-publish.yml Removed outdated GitHub Packages publish workflow
Comments suppressed due to low confidence (3)

.github/workflows/publish.yml:1

  • The comment says this workflow will run tests, but the test step is commented out. Update the description to reflect actual steps or re-enable the test job.
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created

.github/workflows/publish.yml:4

  • [nitpick] The workflow name is quite generic; consider renaming it (e.g., "Publish Packages to GitHub & npm") to clarify its purpose.
name: Node.js Package

.github/workflows/publish.yml:54

  • [nitpick] This step is duplicated in multiple jobs; consider extracting it into a reusable composite action or define a job that both publish jobs can depend on.
- run: cp README.md packages/stencil-library

@maximiliani maximiliani merged commit 1a83033 into main Jun 5, 2025
6 checks passed
@maximiliani maximiliani deleted the alert-autofix-21 branch June 5, 2025 08:03
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