Skip to content

Commit 71890c8

Browse files
authored
Use just this repo for the project (#129)
* Delete .github/workflows/pr_comment.yml * Update README.md * Create schema.json * Create validate.yml
1 parent 08fc39f commit 71890c8

File tree

4 files changed

+178
-28
lines changed

4 files changed

+178
-28
lines changed

.github/workflows/pr_comment.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/validate.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Validate JSONs
2+
3+
on:
4+
pull_request_target:
5+
paths:
6+
- '/_data/collection.json'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
schema-check:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{github.event.pull_request.head.ref}}
21+
repository: ${{github.event.pull_request.head.repo.full_name}}
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20.x'
26+
- name: Install dependencies
27+
run: |
28+
npm install -g ajv-formats
29+
npm install -g ajv-cli
30+
- name: Run schema check
31+
run: |
32+
ajv validate -s schema.json -d src/data/collection.json --all-errors --errors=text --verbose=true -c=ajv-formats 1>> log.txt 2>&1
33+
- name: Show Validation Issues
34+
if: failure()
35+
run: cat log.txt
36+
- name: Attach Log
37+
uses: actions/upload-artifact@v4
38+
if: failure()
39+
with:
40+
name: JSONValidationLog
41+
path: log.txt
42+
- name: Comment Validation Issues
43+
if: failure()
44+
uses: actions/github-script@v7
45+
with:
46+
github-token: ${{secrets.GITHUB_TOKEN}}
47+
script: |
48+
const fs = require("fs");
49+
const logPath = `${process.env.GITHUB_WORKSPACE}/log.txt`;
50+
const logString = fs.readFileSync(logPath).toString().trimEnd();
51+
github.issues.createComment({
52+
issue_number: ${{ github.event.number }},
53+
owner: context.repo.owner,
54+
repo: context.repo.repo,
55+
body: `**The following issues were identified:**\n\n<details><summary>Summary</summary>\n\n\`\`\`\n${logString}\n\`\`\`\n\n</details>`
56+
})

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# VWAD Page on the OWASP Website
1+
# VWAD Pages on the OWASP Website
22

3-
This repository contains the files that build the Vulnerable Web Applications Directory Project's page on the main OWASP website. The page can be found at: https://owasp.org/www-project-vulnerable-web-applications-directory/
3+
This repository contains the files that build the Vulnerable Web Applications Directory Project's pages on the main OWASP website. The page can be found at: <https://owasp.org/www-project-vulnerable-web-applications-directory/>
44

55
Documentation explaining the files in this repo can be found at: https://owasp.org/migration
66

77
## Contributions
88

9-
Any contributions to the directory itself should be made via [VWAD's project repo](https://github.com/OWASP/OWASP-VWAD).
9+
Apps can be add by editing: [`_data/collection.json`](https://github.com/OWASP/www-project-vulnerable-web-applications-directory/blob/master/_data/collection.json)
1010

1111
## Getting Started
1212

schema.json

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"type": "array",
3+
"items": {
4+
"$ref": "#/definitions/VWADEntry"
5+
},
6+
"title": "OWASP VWAD Schema",
7+
"definitions": {
8+
"VWADEntry": {
9+
"type": "object",
10+
"additionalProperties": false,
11+
"properties": {
12+
"url": {
13+
"type": "string",
14+
"format": "uri"
15+
},
16+
"name": {
17+
"type": "string"
18+
},
19+
"collection": {
20+
"type": "array",
21+
"items": {
22+
"type": "string",
23+
"enum": [
24+
"container",
25+
"mobile",
26+
"online",
27+
"offline"
28+
]
29+
}
30+
},
31+
"technology": {
32+
"type": "array",
33+
"items": {
34+
"type": "string"
35+
}
36+
},
37+
"references": {
38+
"type": "array",
39+
"items": {
40+
"$ref": "#/definitions/Reference"
41+
}
42+
},
43+
"author": {
44+
"oneOf": [
45+
{
46+
"type": "null"
47+
},
48+
{
49+
"type": "string"
50+
}
51+
]
52+
},
53+
"notes": {
54+
"oneOf": [
55+
{
56+
"type": "null"
57+
},
58+
{
59+
"type": "string"
60+
}
61+
]
62+
},
63+
"badge": {
64+
"oneOf": [
65+
{
66+
"type": "null"
67+
},
68+
{
69+
"type": "string"
70+
}
71+
]
72+
}
73+
},
74+
"required": [
75+
"author",
76+
"badge",
77+
"collection",
78+
"name",
79+
"notes",
80+
"references",
81+
"technology",
82+
"url"
83+
],
84+
"title": "VWADEntry"
85+
},
86+
"Reference": {
87+
"type": "object",
88+
"additionalProperties": false,
89+
"properties": {
90+
"name": {
91+
"$ref": "#/definitions/Name"
92+
},
93+
"url": {
94+
"type": "string",
95+
"format": "uri"
96+
}
97+
},
98+
"required": [
99+
"name",
100+
"url"
101+
],
102+
"title": "Reference"
103+
},
104+
"Name": {
105+
"type": "string",
106+
"enum": [
107+
"guide",
108+
"download",
109+
"docker",
110+
"downloads",
111+
"announcement",
112+
"live",
113+
"demo",
114+
"preview"
115+
],
116+
"title": "Name"
117+
}
118+
}
119+
}

0 commit comments

Comments
 (0)