Skip to content

ci: Add explicit permissions to GitHub Actions workflows - #607

Merged
congminh1254 merged 1 commit into
mainfrom
copilot/fix-workflow-permissions-issue
Nov 19, 2025
Merged

congminh1254 merged 1 commit into
mainfrom
copilot/fix-workflow-permissions-issue

Conversation

Copilot AI commented Nov 19, 2025 •

Copy link
Copy Markdown
Contributor

GitHub Actions workflows lacked explicit permissions declarations, flagged as a security issue. Workflows using pull_request_target are particularly sensitive as they execute in the base repository context with access to secrets.

Changes

Added minimal required permissions to all workflows:

  • build_and_test.yml: contents: read - for checkout and build operations
  • releases.yml: contents: read - for release event processing
  • semantic-pr.yml: pull-requests: read - for PR title validation
  • spell-check-lint.yml: contents: read - for checkout operations

Example

name: Semantic PR

on:
  pull_request_target:
    types: [opened, edited, synchronize]

permissions:
  pull-requests: read

jobs:
  main:
    name: Validate semantic PR title
    runs-on: ubuntu-latest
    steps:
      - uses: amannn/action-semantic-pull-request@v4
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Follows principle of least privilege by granting only the minimum permissions each workflow requires.

Original prompt

Fix the issue "Workflow does not contain permissions" in this repo


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@CLAassistant

CLAassistant commented Nov 19, 2025 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coveralls

coveralls commented Nov 19, 2025 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 19498279113

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 85.581%

Totals Coverage Status
Change from base Build 18982928146: 0.0%
Covered Lines: 4609
Relevant Lines: 5191

💛 - Coveralls

Copilot AI changed the title [WIP] Fix workflow permissions issue in repository Add explicit permissions to GitHub Actions workflows Nov 19, 2025
@congminh1254
congminh1254 force-pushed the copilot/fix-workflow-permissions-issue branch from 0640260 to fc660ce Compare November 19, 2025 10:34
@congminh1254 congminh1254 changed the title Add explicit permissions to GitHub Actions workflows ci: Add explicit permissions to GitHub Actions workflows Nov 19, 2025
Copilot AI requested a review from congminh1254 November 19, 2025 10:38
@congminh1254
congminh1254 marked this pull request as ready for review November 19, 2025 10:44
@congminh1254
congminh1254 requested a review from a team November 19, 2025 10:44
@congminh1254
congminh1254 merged commit f7bc200 into main Nov 19, 2025
17 of 18 checks passed
@congminh1254
congminh1254 deleted the copilot/fix-workflow-permissions-issue branch November 19, 2025 10:49
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.

5 participants