Improve broken security-events handling for private repositories without Advanced Security

Open
#2,125 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
github-actions, typescript
Domain
ci-cd, security

Research direction

Start with pull request 2121 discussion and issue 2117, then compare check-spelling's unknown-words.sh sections at lines 1122-1126 and 1610-1618. Trace the action's security-events/SARIF handling and verify that private repositories without Advanced Security receive a non-fatal response rather than terminating consuming workflows.

Written by the indexing model from the issue text.

Description

As noted in https://github.com/github/codeql-action/pull/2121#discussion_r1483012019 and https://github.com/github/codeql-action/issues/2117#issuecomment-1934863805, check-spelling has special code to handle the case where a user thinks they can use security-events: ... to talk to sarif reporting, but they're in a private repository and that repository doesn't have GitHub Advanced Security enabled:

https://github.com/check-spelling/check-spelling/blob/26b46adbdebd5dd0b34c7155113d50c40f43fb22/unknown-words.sh#L1610-L1618
https://github.com/check-spelling/check-spelling/blob/26b46adbdebd5dd0b34c7155113d50c40f43fb22/unknown-words.sh#L1122-L1126

Which results in this (more or less):
image

Check Spelling: .github/workflows/spelling.yml#L106
Unsupported configuration: use_sarif needs GitHub Advanced Security to be enabled - see https://docs.github.com/get-started/learning-about-github/about-github-advanced-security. (unsupported-configuration)


The codeql-action should have some code to handle this as well.

Ideally it'd do it in a way that is not fatal to actions/workflows that consume it.

check-spelling has to carefully decide not to call github/codeql-action today if it figures out that it'll fail, otherwise the action/workflow die because of this fault.

Dominant language
TypeScript
Stars
1.6k
Forks
493
Avg merge
1d 13h
Merged PRs (30d)
44

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/codeql-action

All issues in github/codeql-action

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.