@@ -39,15 +39,15 @@ jobs:
39
39
# Remove the begining of the README to extract the example.
40
40
(echo '```toml'; sed -e '1,/```toml/d' README.md) > EXAMPLE_README.md
41
41
while read FILE ; do
42
- [ "$(dirname "$FILE")" != advisories/reserved ] || continue
43
42
echo -n "$FILE: "
44
43
docker run --rm -v $PWD:/repo --workdir /repo haskell/hsec-tools:latest /bin/hsec-tools check "$FILE" || RESULT=1
45
- done < <(find advisories EXAMPLE_README.md EXAMPLE_ADVISORY.md -type f -name "*.md")
44
+ done < <(find advisories/published EXAMPLE_README.md EXAMPLE_ADVISORY.md -type f -name "*.md")
46
45
exit $RESULT
47
46
- name : Run advisory uniqueness checks
48
47
run : |
49
- ! find advisories -type f -name '*.md' -print0 \
50
- | xargs -0n1 basename | sort | uniq -c | grep -E -v '[[:space:]]*1 '
48
+ ! find advisories/published -type f -name '*.md' \
49
+ | sed -E 's|.*/([0-9]+)/([0-9]+)\.md|\1/\2.md|' \
50
+ | sort | uniq -c | grep -E -v '[[:space:]]*1 '
51
51
- name : Generate OSV data
52
52
run : |
53
53
DATA_DIR=$PWD/osv
58
58
YEAR=$(echo "$ID" | cut -d - -f 2)
59
59
mkdir -p $DATA_DIR/$YEAR
60
60
docker run --rm -v $PWD:/repo --workdir /repo haskell/hsec-tools:latest /bin/hsec-tools osv "$FILE" > $DATA_DIR/$YEAR/$ID.json
61
- done < <(find advisories -type f -name "*.md" | grep -v '^advisories/reserved/' )
61
+ done < <(find advisories/published -type f -name "*.md")
62
62
- name : Validate OSV data
63
63
run : |
64
64
curl -OL https://raw.githubusercontent.com/ossf/osv-schema/refs/heads/main/validation/schema.json
84
84
- name : Generate snapshot data
85
85
run : |
86
86
docker run --rm -v $PWD:/repo --workdir /repo haskell/hsec-tools:latest /bin/hsec-tools generate-snapshot . snapshot
87
- diff -r advisories snapshot/advisories | grep -v gitkeep | grep -v 'Only in advisories: reserved' | grep Only && echo 'Some advisories have been created/deleted' && exit 1 || exit 0
87
+ diff -r advisories/published snapshot/advisories/published | grep -v gitkeep | grep Only && echo 'Some advisories have been created/deleted' && exit 1 || exit 0
88
88
- name : Publish snapshot data
89
89
if : ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'haskell/security-advisories' }}
90
90
env :
0 commit comments