Skip to content

Conversation

@CorentynDevPro
Copy link
Owner

Added minimal permissions to reduce GitHub token exposure and switched to using pnpm's frozen lockfile for reproducible dependency installs. Improved artifact upload for coverage reports and build outputs, and made formatting consistent throughout the workflow.

Added minimal permissions to reduce GitHub token exposure and switched to using pnpm's frozen lockfile for reproducible dependency installs. Improved artifact upload for coverage reports and build outputs, and made formatting consistent throughout the workflow.
Copy link

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 enhances the CI/CD pipeline with security improvements and build reproducibility. The changes add minimal GitHub token permissions to follow the principle of least privilege, enforce frozen lockfile installs to ensure reproducible builds, and improve artifact handling for test coverage and build outputs.

  • Added minimal permissions (contents: read) at the workflow level to reduce security risks
  • Switched to pnpm install --frozen-lockfile across all jobs for reproducible dependency installations
  • Enhanced artifact upload for coverage reports and improved consistency in formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 131 to 133
path: |
coverage
coverage/**/*
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The path specification is redundant. The pattern coverage already matches the directory and coverage/**/* adds no additional coverage. Simplify to just coverage/ to capture the entire directory contents.

Suggested change
path: |
coverage
coverage/**/*
path: coverage/

Copilot uses AI. Check for mistakes.
run: pnpm run test

- name: Upload coverage artifact (if produced)
if: always()
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

Using if: always() will attempt to upload artifacts even when the test step is skipped or cancelled, not just on failure. Consider using if: success() || failure() instead to only upload when tests actually run but potentially fail, avoiding unnecessary uploads when the workflow is cancelled or skipped.

Suggested change
if: always()
if: success() || failure()

Copilot uses AI. Check for mistakes.
runs-on: ubuntu-latest
needs: [build]
needs: [ build ]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The docker job builds and caches Docker images but has only contents: read permission. If this job needs to use GitHub Actions cache (type=gha), it requires actions: write permission. Consider adding job-level permissions or documenting that the cache operations may fail silently with the current minimal permissions.

Suggested change
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: read
actions: write

Copilot uses AI. Check for mistakes.
@CorentynDevPro
Copy link
Owner Author

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Nov 20, 2025

@CorentynDevPro I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits November 20, 2025 16:00
- Changed coverage artifact upload condition to `success() || failure()`
- Simplified coverage artifact path to `coverage/`
- Added `actions: write` permission to docker job

Co-authored-by: CorentynDevPro <[email protected]>
Apply bot review comments: fix coverage upload condition and docker permissions
@CorentynDevPro CorentynDevPro merged commit eef9da0 into main Nov 21, 2025
3 of 5 checks passed
@CorentynDevPro CorentynDevPro deleted the fix-ci branch November 21, 2025 07:25
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