argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.86k stars 5.45k forks source link

Allow forks to opt-in for codeql #19993

Closed jsoref closed 1 month ago

jsoref commented 1 month ago

Summary

7832 disabled running codeql and a number of other workflows in forks. This isn't terrible, but it isn't ideal. (The average repository was definitely wasting cycles, and changing the behavior saves all those cycles.)

Motivation

There are a handful of "CodeQL" "triggered" "pull requests" at the moment. It'd be handy if I could set a variable in my fork to enable using CodeQL. It would be off by default for any forks that don't have the variable defined, but it would be a lot cleaner than users having to commit to master just to run codeql in forks.

Proposal

Change this line (note, this is not the line as it exists on master, it's the line present in my fork as I had to change it in order to trigger CodeQL, the only difference being a leading #): https://github.com/argoproj/argo-cd/blob/4014cc8b040f55dc698295d658cf0eb780ea7203/.github/workflows/codeql.yml#L26

To

if: github.repository == 'argoproj/argo-cd' || vars.enable_codeql

(Eventually enable_codeql could be set as a var in the argoproj/argo-cd repository, and the first half of the if could be removed.)

terrytangyuan commented 1 month ago

Sounds good to me