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

Update unguarded-action-lib.ql to catch uses of actions-util.ts #542

Merged
merged 1 commit into from
Jun 2, 2021

Conversation

robertbrignull
Copy link
Contributor

I'm not 100% sure this change is correct but the PR checks should tell us as this should introduce at least one alert because it'll now spot accesses of actions-util.ts. Because it's using matches but then with a string with no wildcards in it I'm assuming this must be a mistake.

Alternatively we could probably just use getImportedPath().getValue() = "./actions-util") since we currently have all our source in one directory. Is that better? Using matches lets us catch this potential future edge case.

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.

Copy link
Contributor

@adityasharad adityasharad left a comment

Choose a reason for hiding this comment

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

Sensible. I was similarly worried that we would break the existing pattern by moving files around.

@adityasharad adityasharad merged commit 1ec2fd7 into main Jun 2, 2021
@adityasharad adityasharad deleted the robertbrignull/import-actions-lib branch June 2, 2021 16:56
@aeisenberg
Copy link
Contributor

Thanks for the fix. It's not showing any new alerts. Is that expected?

@robertbrignull
Copy link
Contributor Author

It's not showing any new alerts. Is that expected?

I was hoping this would generate a new alert. I think that it should be catching the import of setMode in runner.ts should be triggering an alert. I made this PR just off a hunch but probably someone will need to try the query out locally to work it why it's not catching that. Unless of course I'm mistaken and you think that shouldn't be an alert.

@aeisenberg
Copy link
Contributor

Actually, I think the reason is that you based this change on main, but the offending code was still in a PR. When I rebased #539 on main, I started seeing the warning.

@robertbrignull
Copy link
Contributor Author

Ah thanks for working that out. That makes perfect sense.

@github-actions github-actions bot mentioned this pull request Jun 7, 2021
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.

3 participants