Title: Add a CLI interface to the upload-sarif action by robertbrignull · Pull Request #147 · github/codeql-action · GitHub
Open Graph Title: Add a CLI interface to the upload-sarif action by robertbrignull · Pull Request #147 · github/codeql-action
X Title: Add a CLI interface to the upload-sarif action by robertbrignull · Pull Request #147 · github/codeql-action
Description: This PR is a first attempt at adding a command lint interface to the codeql-action. This PR only deals with the upload-sarif action, and largely ignores the others except the minimum changes required to keep them working. The main things done here are: Introduce src/cli.ts which is the entrypoint to the CLI. I'm using the commander library here to do the CLI part, and it generates -h options and stuff like that. I'm open to other libraries instead if someone has a favourite that is better. Introduce a new build-cli npm script, that uses webpack to bundle the cli.ts file and all its dependencies into a single file, that is output to cli/cli.js. This file is not checked into the repository as it isn't needed to run the action normally. I felt it therefore didn't belong in the lib directory, but I don't think the cli directory name is great either. I'd be very open to suggestions here. Introduce logging.ts which mostly just wraps the @actions/core package, and replaces it with stuff like console.log when not on actions. Adds lots of extra function parameters. I think the way we're going to have to do things, is pass parameters from the entrypoint all the way into the functions that need them. That way the shared code doesn't have to have different cases for actions vs the CLI. At the entrypoints we pass the inputs, either from command line args, or core.getInput, or the environment, and pass it onwards to where it is needed. Hopefully this won't get too ugly. The diff looks huge because of node_modules changes, but if you ignore those and other generated files, the actual churn is only about 300 lines. This code is largely untested in practice. I wanted to get the PR up soon so people could see what it looks like. Merge / deployment checklist Confirm this change is backwards compatible with existing workflows. Confirm the readme has been updated if necessary.
Open Graph Description: This PR is a first attempt at adding a command lint interface to the codeql-action. This PR only deals with the upload-sarif action, and largely ignores the others except the minimum changes requir...
X Description: This PR is a first attempt at adding a command lint interface to the codeql-action. This PR only deals with the upload-sarif action, and largely ignores the others except the minimum changes requir...
Opengraph URL: https://github.com/github/codeql-action/pull/147
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:50d5fc0c-bc2f-f45b-852f-d0b326625a70 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9B44:2DCB9C:DBAFEB:12C62C1:6A5563BE |
| html-safe-nonce | e58dbb5d0c2cf43552efdcb9012b1465f361683fd311244ea582abb8f2f36e2f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjQ0OjJEQ0I5QzpEQkFGRUI6MTJDNjJDMTo2QTU1NjNCRSIsInZpc2l0b3JfaWQiOiI0NjI0NjU4OTIxNjg0Mjk2NjM4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2c7ccaa4d41b34c84f25bfb81c3e4d1ed05f6eef26c02ed9a59cac9cf9ab01e9 |
| hovercard-subject-tag | pull_request:465625862 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/github/codeql-action/pull/147/files |
| twitter:image | https://avatars.githubusercontent.com/u/3749000?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3749000?s=400&v=4 |
| og:image:alt | This PR is a first attempt at adding a command lint interface to the codeql-action. This PR only deals with the upload-sarif action, and largely ignores the others except the minimum changes requir... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/github/codeql-action git https://github.com/github/codeql-action.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 259445878 |
| octolytics-dimension-repository_nwo | github/codeql-action |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 259445878 |
| octolytics-dimension-repository_network_root_nwo | github/codeql-action |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8201d0b7bc32164c4662de52242e463a356df543 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width