Skip to content

Commit

Permalink
ci: fix osv data publication
Browse files Browse the repository at this point in the history
  • Loading branch information
blackheaven committed Mar 29, 2024
1 parent 7fbbee2 commit eb3f994
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
uses: DeterminateSystems/flake-checker-action@v4
- name: Build executable (hsec-tools)
run: nix -L build
- name: Build executable (hsec-sync)
run: nix -L build '.#hsec-sync'
- name: Build docker image
run: nix build -L '.#packages.x86_64-linux.hsec-tools-image'
- run: mkdir -p ~/.local/dockerImages
Expand Down Expand Up @@ -62,22 +60,34 @@ jobs:
docker run --rm -v $PWD:/repo --workdir /repo haskell/hsec-tools:latest /bin/hsec-tools osv "$FILE" > $DATA_DIR/$YEAR/$ID.json
done < <(find advisories -type f -name "*.md" | grep -v '^advisories/reserved/')
- name: Publish OSV data
if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'haskell/security-advisories' }}
# if: ${{ github.event_name == 'push' && github.ref_name == 'main' && github.repository == 'haskell/security-advisories' }}
env:
GITHUB_SHA: ${{ github.sha }}
run: |
echo "-1"
DATA_DIR=$PWD/osv
BRANCH=generated/osv-export
REF=refs/remotes/origin/$BRANCH
echo "0"
export GIT_WORK_TREE=$DATA_DIR
git read-tree "$REF"
echo "1"
git add --all --intent-to-add
echo "2"
git diff --quiet && exit
echo "3"
git add --all
echo "4"
TREE=$(git write-tree)
echo "5"
git config user.email [email protected]
echo "6"
git config user.name "Haskell Security Response Team"
echo "7"
COMMIT=$(git commit-tree "$TREE" -p "$REF" -m "$(date --utc --rfc-3339=seconds) ($GITHUB_SHA)")
echo "8"
git push origin $COMMIT:$BRANCH
echo "9"
- name: Generate the website
run: |
mkdir generatedWebsite
Expand Down

0 comments on commit eb3f994

Please sign in to comment.