Remove codeQl keys from add-ons metadata#10164
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an automated cleanup to remove legacy CodeQL-related keys from add-on metadata JSON files, and adds a GitHub Actions workflow intended to run that cleanup and commit the result.
Changes:
- Added a Bash script that scans
addons/**.jsonand removes legacycodeQL-*keys viajq. - Added a GitHub Actions workflow to run the script and push any resulting updates back to the repository.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| remove-codeql-keys.sh | Adds a jq-based cleanup script to remove legacy CodeQL metadata keys from JSON files under addons/. |
| .github/workflows/removeCodeQl.yml | Adds a workflow intended to run the cleanup script and commit/push any changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Remove codeQl keys from add-ons metadata | ||
| run: | | ||
| ./remove-codeql-keys.sh | ||
| git add addons | ||
| if ! git diff --cached --quiet; then | ||
| git config user.name "github-actions" | ||
| git config user.email "github-actions@github.com" | ||
| git commit -m "Remove CodeQL keys from add-ons metadata" | ||
| git push | ||
| fi |
| # Remove legacy keys that are no longer used, regardless of where they appear. | ||
| jq 'del( | ||
| .. | .["codeQL-warnings"]?, | ||
| .. | .["codeQL-errors"]?, | ||
| .. | .["codeQl-warnings"]?, | ||
| .. | .["codeQlErrors"]? | ||
| )' "$file" > "$tmp_file" |
Fix removeCodeQl workflow failure by making cleanup script executable
|
I used a GitHub workflow (GitHub Actions), so that the process can be seen. I don't have native Linux nor jq installed on my computer. |
Related issue
Fixes #9727
Development approach
Added an sh script and a GitHub workflow to remove codeQl-warnings and codeQl-errors, which according to Copilot may be writen in different ways, from add-ons metadata.
Tests
https://github.com/nvdaes/addon-datastore/actions/runs/29154980713