feat: enable self-detection of actions config via CLI#45
feat: enable self-detection of actions config via CLI#45abhinavgautam01 wants to merge 2 commits into
Conversation
Signed-off-by: abhinavgautam01 <abgautam1017@gmail.com>
|
i think the goal here would be to enable most, if not all, of the configuration values for the action to be surfaced through the CLI. That way collection tools like CollectOSS would be able to store, and enable analysis to be run based on not only the projects own configured AI label name, but also things like their configured detection thresholds for what even counts as an "ai contribution" in the first place To that end, i think the CLI would be better named something like |
…ters Signed-off-by: abhinavgautam01 <abgautam1017@gmail.com>
thanks for the feedback... i completely agree that surfacing all the configuration values gives downstream tools (like Augur and CollectOSS) much better visibility into the actual detection thresholds for a project.... i have pushed an update to this PR that:
let me know if this looks good to you or if you need any other tweaks..! |
fixes #16
descirption
Downstream tools (like Augur) that use this application to analyze repositories need to dynamically detect which label the maintainers have configured for AI usage. Previously, this required downstream tools to implement their own YAML parsers to figure it out...
This PR shifts that responsibility natively into the CLI, allowing it to inspect a repository's
.github/workflowsdirectory and expose the configured labels in a clean JSON format...Changes Made
gopkg.in/yaml.v3to robustly parse GitHub Action workflow files.workflowpackage which scans.github/workflows/*.yml, identifying any usage ofchaoss/disclosure. It parses out the explicitwith: label:parameter or correctly falls back to the defaultai-detectedlabel.disclosure actions [repo-path]subcommand to output the discovered labels in a machine-readable JSON format:{"labels": ["ai-detected"]}.workflow_test.goto ensure accurate extraction logic and defaults.Testing
go test ./...passes cleanly.disclosure actions .against a repo containing the action correctly surfaces the AI labels in JSON.