Skip to content

ci: add minimal permissions block to workflows#1

Merged
Pomdapis merged 1 commit intomainfrom
vk/4451-pom-176-workflow
Apr 24, 2026
Merged

ci: add minimal permissions block to workflows#1
Pomdapis merged 1 commit intomainfrom
vk/4451-pom-176-workflow

Conversation

@Pomdapis
Copy link
Copy Markdown
Contributor

Summary

  • Adds an explicit workflow-level permissions: contents: read block to .github/workflows/ci.yml (principle of least privilege).
  • .github/workflows/release.yml already declares contents: write + packages: write; verified and left unchanged.

Context

Fixes CodeQL alert #1 (rule actions/missing-workflow-permissions, CWE-275). Refs POM-176.

Test plan

  • YAML validates: python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml')); yaml.safe_load(open('.github/workflows/release.yml'))"
  • CI passes on this PR
  • CodeQL alert ci: add minimal permissions block to workflows #1 auto-closes after merge

Follow principle of least privilege: ci.yml now declares contents:read
explicitly; release.yml permissions verified/aligned.

Refs POM-176, CodeQL alert #1 (actions/missing-workflow-permissions).
Copilot AI review requested due to automatic review settings April 24, 2026 13:45
Copy link
Copy Markdown

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

Adds explicit GitHub Actions workflow permissions to satisfy the actions/missing-workflow-permissions CodeQL rule and apply least-privilege defaults.

Changes:

  • Add workflow-level permissions: contents: read to .github/workflows/ci.yml.

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

Comment thread .github/workflows/ci.yml
contents: read

jobs:
build-test:
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

Workflow-level permissions replaces GitHub’s default token permissions for all scopes; with only contents: read the GITHUB_TOKEN will have actions: none. This is likely to break actions/cache@v4 (cache save/restore) and actions/upload-artifact@v4 (artifact upload), which require actions: write. Consider adding actions: write (preferably at job-level if you want to keep least-privilege scope tight).

Suggested change
build-test:
build-test:
permissions:
contents: read
actions: write

Copilot uses AI. Check for mistakes.
@Pomdapis Pomdapis merged commit 67b9b74 into main Apr 24, 2026
9 checks passed
@Pomdapis Pomdapis deleted the vk/4451-pom-176-workflow branch April 24, 2026 13:49
Pomdapis added a commit that referenced this pull request Apr 26, 2026
## Summary

PR #23 incorrectly bumped CHANGELOG to `[1.0.0-preview.2] - 2026-04-26`
with the quality-sweep entries — but tag `v1.0.0-preview.2` was already
cut on **2026-04-25** from a different commit set (PRs #1-7) and
**already published to nuget.org** (`Compendium.Core 1.0.0-preview.2` is
live). Reusing that version was a mistake.

This PR reconciles the CHANGELOG with the published reality and rolls
today's work into a new **preview.3**:

### `[1.0.0-preview.2] - 2026-04-25` — rewritten retroactively

Now matches the auto-generated GitHub release notes for
`v1.0.0-preview.2`:
- **Added** — `Compendium.Adapters.Shared` (PII masking utilities,
introduced in #3).
- **Changed** — Dependabot bumps #4-7, OSS governance scaffolding.
- **Security** — workflow `permissions:` block (#1), tenant log
sanitization (#2), email removal from adapter logs / GDPR (#3).

### `[1.0.0-preview.3] - 2026-04-26` — new

Everything since `v1.0.0-preview.2`:
- **Added** — DocFX site (#17), 5 ADRs (#14), public ROADMAP (#15),
getting-started guide (#20), 4 concept pages (#21), 8 adapter how-to
guides (#22).
- **Changed** — CodeQL Default Setup → `extended` query suite.
- **Security** — `softprops/action-gh-release` pinned to commit SHA
(#16, alert #28 closed).

## Test plan

- [ ] CI green on this PR.
- [ ] After merge, tag `v1.0.0-preview.3` triggers Release workflow
successfully.
- [ ] `Compendium.* @ 1.0.0-preview.3` published on nuget.org.
- [ ] GitHub Release `v1.0.0-preview.3` created with auto-generated
notes.

VK: POM-186 (Code Quality sweep parent).

Co-authored-by: sacha <sacha@scojhconsult.com>
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