Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete the results directory in between runs. #955

Merged
merged 3 commits into from
Feb 28, 2022

Conversation

chrisgavin
Copy link
Contributor

The default results directory of the CodeQL Action is in a non-ephemeral directory. This means it will be persisted between runs. The CodeQL Action also does not keep track of what languages it has produced results for in this run. That means that if a language is present in one run, but absent in the next, the CodeQL Action will upload it regardless.

By deleting the results directory we ensure that stale results will never be used.

I couldn't find a particularly good place to add a test for this (which isn't that surprising, since it's very much an implementation detail), but I've tested manually and verified it's correctly no longer uploading stale results.

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.

@aeisenberg
Copy link
Contributor

Thanks for creating this PR. I'll take a look shortly. It is likely that this fix will also address https://github.com/github/code-scanning/issues/5318

src/analyze.ts Outdated Show resolved Hide resolved
@chrisgavin chrisgavin force-pushed the delete-results-directory branch from 02893b4 to d63f798 Compare February 28, 2022 18:56
@chrisgavin chrisgavin marked this pull request as ready for review February 28, 2022 19:30
@chrisgavin chrisgavin requested a review from a team as a code owner February 28, 2022 19:30
@chrisgavin chrisgavin force-pushed the delete-results-directory branch from 2df7390 to 938e0a0 Compare February 28, 2022 19:43
Copy link
Contributor

@aeisenberg aeisenberg left a comment

Choose a reason for hiding this comment

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

👍🏼

@chrisgavin chrisgavin merged commit b1c781d into main Feb 28, 2022
@chrisgavin chrisgavin deleted the delete-results-directory branch February 28, 2022 20:26
@github-actions github-actions bot mentioned this pull request Mar 7, 2022
5 tasks
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