Skip to content

Commit 4a4fc71

Browse files
ci: really fix docker commands for osv export
1 parent 950e1fa commit 4a4fc71

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/check-advisories.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ jobs:
4848
(echo '```toml'; sed -e '1,/```toml/d' README.md) > EXAMPLE_README.md
4949
while read FILE ; do
5050
echo -n "$FILE: "
51-
docker run --rm -v ${{ github.workspace }}:/repo haskell/hsec-tools:latest /bin/hsec-tools check "repo/$FILE" || RESULT=1
51+
docker run --rm -v $PWD:/repo --workdir /repo haskell/hsec-tools:latest /bin/hsec-tools check "$FILE" || RESULT=1
5252
done < <([ ${#CHANGED_ADVISORIES[@]} -gt 0 ] && printf "%s\n" "${CHANGED_ADVISORIES[@]}" || find advisories EXAMPLE_README.md EXAMPLE_ADVISORY.md -type f -name "*.md")
5353
exit $RESULT
5454
- name: Run advisory uniqueness checks
5555
run: |
5656
! find source/advisories -type f -name '*.md' -print0 \
5757
| xargs -0n1 basename | sort | uniq -c | grep -E -v '[[:space:]]*1 '
5858
- name: Publish OSV data
59-
if: ${{ github.event_name == 'push' }}
59+
if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'haskell/security-advisories' }}
6060
env:
6161
GITHUB_SHA: ${{ github.sha }}
6262
run: |
@@ -67,7 +67,7 @@ jobs:
6767
ID=$(basename "$FILE" .md)
6868
YEAR=$(echo "$ID" | cut -d - -f 2)
6969
mkdir -p $DATA_DIR/$YEAR
70-
docker run --rm -v ${{ github.workspace }}:/repo --workdir /repo haskell/hsec-tools:latest /bin/hsec-tools osv "$FILE" > $DATA_DIR/$YEAR/$ID.json
70+
docker run --rm -v $PWD:/repo --workdir /repo haskell/hsec-tools:latest /bin/hsec-tools osv "$FILE" > $DATA_DIR/$YEAR/$ID.json
7171
done < <(find advisories -type f -name "*.md")
7272
BRANCH=generated/osv-export
7373
REF=refs/remotes/origin/$BRANCH

0 commit comments

Comments
 (0)