Skip to content

Commit e845f6d

Browse files
committed
Add updates validation
2 parents 6890dd9 + f66733f commit e845f6d

12 files changed

Lines changed: 4008 additions & 14 deletions

File tree

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ jobs:
1818
- run: npm install
1919
- run: npm run test:metadata
2020

21+
validate_schema:
22+
# Do not run on the creation of the repository
23+
if: github.event.created != true
24+
runs-on: ubuntu-22.04
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-node@v3
28+
with:
29+
node-version: 20
30+
- run: npm install
31+
- run: npm run test:schema
32+
2133
lint:
2234
# Do not run on the creation of the repository
2335
if: github.event.created != true
@@ -29,3 +41,26 @@ jobs:
2941
node-version: 20
3042
- run: npm install
3143
- run: npm run lint
44+
45+
validate_modified_declarations:
46+
# Do not run on the creation of the repository
47+
if: github.event.created != true
48+
runs-on: ubuntu-22.04
49+
steps:
50+
- uses: actions/checkout@v4
51+
with:
52+
fetch-depth: 0 # fetch all history for all branches and tags
53+
- uses: actions/setup-node@v3
54+
with:
55+
node-version: 20
56+
- run: npm install
57+
- run: npm run test:modified
58+
- name: Generate artifacts
59+
if: ${{ failure() }}
60+
run: npm run start:modified
61+
- uses: actions/upload-artifact@v4
62+
if: ${{ failure() }}
63+
with:
64+
name: snapshots_and_versions
65+
path: ./data
66+
if-no-files-found: error

declarations/Amazon.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"select": ".ResourcesList"
77
},
88
"Systemic Risks — 2023": {
9-
"fetch": "https://trustworthyshopping.aboutamazon.com/attachment-file-eu-dsa-risk-assessment-report-amazon-2023"
9+
"fetch": "https://trustworthyshopping.aboutamazon.com/attachment-file-eu-dsa-risk-assessment-report-amazon-2023#pdf"
1010
},
1111
"Systemic Risks — 2024": {
1212
"fetch": "https://trustworthyshopping.aboutamazon.com/attachment-file-eu-dsa-risk-assessment-report-amazon-2024-pdf"

declarations/Facebook.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Facebook",
33
"terms": {
44
"Systemic Risks — 2024": {
5-
"fetch": "https://transparency.meta.com/sr/dsa-sra_results_report-2024-facebook"
5+
"fetch": "https://transparency.meta.com/sr/dsa-sra_results_report-2024-facebook#pdf"
66
}
77
}
88
}

declarations/Instagram.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Instagram",
33
"terms": {
44
"Systemic Risks — 2024": {
5-
"fetch": "https://transparency.meta.com/sr/dsa-sra_results_report-2024-instagram"
5+
"fetch": "https://transparency.meta.com/sr/dsa-sra_results_report-2024-instagram#pdf"
66
}
77
}
88
}

package-lock.json

Lines changed: 19 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"scripts": {
55
"lint": "ota lint",
66
"lint:fix": "ota lint -- --fix",
7-
"test": "ota lint && ota validate metadata",
7+
"test": "ota lint && ota validate declarations",
8+
"test:schema": "ota validate declarations --schema-only",
9+
"test:modified": "ota validate declarations --modified",
810
"test:metadata": "ota validate metadata",
911
"start": "ota track",
1012
"start:collection-api": "ota serve",
@@ -14,6 +16,7 @@
1416
"dataset:schedule": "npm run dataset -- --publish --remove-local-copy --schedule"
1517
},
1618
"dependencies": {
17-
"@opentermsarchive/engine": "^9.1.0"
19+
"@opentermsarchive/engine": "^9.1.1",
20+
"@opentermsarchive/terms-types": "./terms-types"
1821
}
1922
}

terms-types/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { readFile } from 'fs/promises';
2+
3+
export default JSON.parse(await readFile(new URL('./termsTypes.json', import.meta.url)));

0 commit comments

Comments
 (0)