GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Updates the permissions block to be minimal by aeisenberg · Pull Request #689 · github/codeql-action

Conversation

@aeisenberg

@aeisenberg aeisenberg commented Aug 9, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

And adds a permissions block to the README.

Fixes #464.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aeisenberg
aeisenberg requested a review from a team as a code owner August 9, 2021 18:41
@aeisenberg
aeisenberg force-pushed the aeisenberg/update-permissions branch from 9473576 to f374474 Compare August 9, 2021 18:42
@adityasharad

adityasharad commented Aug 9, 2021

Copy link
Copy Markdown
Contributor

From our last internal discussion about this, I believe that actions: read is (only) needed if you are analyzing a private repository, and security-events: write is (only) needed if you are not analyzing a pull request. And I think we need at least contents: read (or pull-requests: read for PRs). The overlapping scopes for PRs make this a bit confusing.

So perhaps let's go with the recommendation of actions: read, contents: read, security-events: write? If it turns out that's not entirely minimal, we can refine it again later.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg

aeisenberg commented Aug 9, 2021

Copy link
Copy Markdown
Contributor Author

Sure, and I can add some comments on when different scopes may not be needed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg

aeisenberg commented Aug 9, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Here are the API calls we are making (just doing a code search for .request:

  • GET /repos/:owner/:repo/actions/runs/:run_id (actions: read)
  • GET /repos/:owner/:repo/actions/workflows (actions: read)
  • PUT /repos/:owner/:repo/code-scanning/analysis/status (security-events: write)
  • GET /enterprise/code-scanning/codeql-bundle/find/{tag} (security-events: read)
  • GET /enterprise/code-scanning/codeql-bundle/download/{asset_id} (security-events: read)
  • GET /repos/:owner/:repo/code-scanning/codeql/databases (security-events: read)
  • PUT /repos/:owner/:repo/code-scanning/codeql/databases/:language (security-events: write)
  • PUT /repos/:owner/:repo/code-scanning/analysis (security-events: write)

Unless I've missed something, we only need security-events: write and actions: read. And the latter is only for private repos.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg
aeisenberg force-pushed the aeisenberg/update-permissions branch from f374474 to 1f9cee9 Compare August 9, 2021 19:56
@adityasharad

adityasharad commented Aug 9, 2021

Copy link
Copy Markdown
Contributor

Plus you need enough permission to check out the repo itself in the workflow (but not in the Action), which I believe is either contents: read or pull_requests: read.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg

aeisenberg commented Aug 9, 2021

Copy link
Copy Markdown
Contributor Author

Ah..yes. Again, only for private repos, it seems. So, contents: read guards the GET /repos/:owner/:repo/contents/:path endpoint. I don't see anything about pull requests, though. This would only be for things like editing the PR itself, or adding comments, etc.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg
Updates the permissions block to be minimal
2175328
 And adds a permissions block to the README.
@aeisenberg
aeisenberg force-pushed the aeisenberg/update-permissions branch from 1f9cee9 to 2175328 Compare August 9, 2021 20:30
adityasharad
adityasharad approved these changes Aug 9, 2021
View reviewed changes

@adityasharad adityasharad left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM once you resolve the changelog conflict. Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@aeisenberg
Merge branch 'main' into aeisenberg/update-permissions
61fb5d7
@aeisenberg
aeisenberg enabled auto-merge August 9, 2021 21:56
@aeisenberg
aeisenberg merged commit 07fa17d into main Aug 9, 2021
@aeisenberg
aeisenberg deleted the aeisenberg/update-permissions branch August 9, 2021 22:12
@github-actions github-actions Bot mentioned this pull request Aug 16, 2021
Merge main into v1 #704
Merged
4 of 5 tasks
@naveensrinivasan

naveensrinivasan commented Sep 14, 2021

Copy link
Copy Markdown

Here are the API calls we are making (just doing a code search for .request:

  • GET /repos/:owner/:repo/actions/runs/:run_id (actions: read)
  • GET /repos/:owner/:repo/actions/workflows (actions: read)
  • PUT /repos/:owner/:repo/code-scanning/analysis/status (security-events: write)
  • GET /enterprise/code-scanning/codeql-bundle/find/{tag} (security-events: read)
  • GET /enterprise/code-scanning/codeql-bundle/download/{asset_id} (security-events: read)
  • GET /repos/:owner/:repo/code-scanning/codeql/databases (security-events: read)
  • PUT /repos/:owner/:repo/code-scanning/codeql/databases/:language (security-events: write)
  • PUT /repos/:owner/:repo/code-scanning/analysis (security-events: write)

Unless I've missed something, we only need security-events: write and actions: read. And the latter is only for private repos.

@aeisenberg I am trying to figure out the required permissions for any GitHub Action. What is the process to get all the necessary permission? Thanks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aeisenberg

aeisenberg commented Sep 14, 2021

Copy link
Copy Markdown
Contributor Author

There's no principled way of doing this that I can think of. An action can make any arbitrary request to the github api. And it can make requests in many ways (since they are just fundamentally REST requests): curl, gh, octokit, etc.

You could try setting very restrictive permissions, and slowly loosen them until you get your workflow passing. Alternatively, you can try to eyeball the code, which could be tricky if the action is doing non-standard things.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@naveensrinivasan

naveensrinivasan commented Sep 14, 2021

Copy link
Copy Markdown

There's no principled way of doing this that I can think of. An action can make any arbitrary request to the github api. And it can make requests in many ways (since they are just fundamentally REST requests): curl, gh, octokit, etc.

You could try setting very restrictive permissions, and slowly loosen them until you get your workflow passing. Alternatively, you can try to eyeball the code, which could be tricky if the action is doing non-standard things.

Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@naveensrinivasan naveensrinivasan mentioned this pull request Sep 20, 2021
Add details on authentication / permissions used during upload actions/upload-artifact#197
Open
This was referenced Mar 18, 2026
docs: add sub-agents based on copilot instructions Hiroki-org/jules-extension#414
Merged
feat: major codebase refactor and CI/CD improvement consistent-k/VodHub#416
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Mar 27, 2026
fix: address OpenSSF Scorecard findings combsmith/broodly#21
Merged
3 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Apr 15, 2026
feat: 코드래빗 리뷰 성능 검증을 위한 테스트 Siul49/moim#1
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 30, 2026
CI: add unit test, CodeQL, FIPS, stale, and labeler workflows opendatahub-io/kube-rbac-proxy#17
Merged
3 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Jun 12, 2026
chore(workflows): pheno safe audit normalization (r2, parse-valid, no placeholde KooshaPari/PhenoShared#176
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 23, 2026
Create defender-for-devops.yml AnshRaj112/salvioris-frontend#4
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Aug 2, 2026
ci: pink-labo 自動化を追加し Devin Slack トリガーに !swe を付与 kouiso/sns-app#2
Merged
8 tasks
This was referenced Aug 11, 2026
ci: scan the library source with ThreatCrush on every PR koajs/router#243
Closed
ci: ne construire que si le changement peut affecter le build InstaZDLL/waveflow-ios#12
Merged
@qodo-code-review qodo-code-review Bot mentioned this pull request Aug 24, 2026
feat(gate): 跨仓 verdict 中继 workflow(ADR-0082/0083,机械核证) Cloudbird-Software/.github#339
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adityasharad adityasharad adityasharad approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Document what permissions are required

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@aeisenberg @adityasharad @naveensrinivasan
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.