Check all submitted NVDA add-ons #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check all submitted NVDA add-ons | |
on: | |
workflow_dispatch: | |
schedule: | |
# perform once a month at the very start of the month | |
- cron: '0 0 1 * *' | |
jobs: | |
checkMetadata: | |
permissions: | |
contents: write | |
pull-requests: write | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
python-version: [ 3.11 ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.headRef }} | |
- name: Create validation errors file | |
run: echo "" > validationErrors.md | |
- name: Checkout validate repo | |
uses: actions/checkout@v4 | |
with: | |
repository: nvaccess/addon-datastore-validation | |
path: validation | |
submodules: true | |
- name: Install addon-datastore-validation dependencies | |
run: | | |
python -m pip install --upgrade wheel | |
pip install -r validation/requirements.txt | |
- name: Delete add-ons with invalid downloads | |
if: always() | |
id: deleteInvalidDownloads | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const checkAddonUrlAndHash = require('./.github/workflows/checkAddonUrlAndHash.js') | |
checkAddonUrlAndHash({core}, "./addons/*/*.json") | |
- name: Commit and push changes | |
if: always() | |
run: | | |
git config user.name github-actions | |
git config user.email [email protected] | |
git checkout delInvalidDownloads | |
git add ./addons/*/*.json | |
git commit -m "Delete invalid downloads" | |
git push | |
- name: create PR for deleting invalid downloads | |
run: gh pr create -B master -H delInvalidDownloads --title 'Delete invalid add-ons' --body 'Delete add-ons with invalid download links or invalid file hashes' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Checkout transformation repo for nvdaAPIVersions.json | |
uses: actions/checkout@v4 | |
with: | |
repository: nvaccess/addon-datastore-transform | |
path: transform | |
- name: Validate all add-ons metadata | |
run: validation/runvalidate ./addons/*/*.json ./transform/nvdaAPIVersions.json --output ./validationErrors.md | |
- name: Upload validation errors as artifact | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: validationErrors | |
path: ./validationErrors.md |