Skip to content

Run CPE validations on FreeBSD Portstree #1432

Run CPE validations on FreeBSD Portstree

Run CPE validations on FreeBSD Portstree #1432

Workflow file for this run

name: Run CPE validations on FreeBSD Portstree
on:
push:
paths-ignore:
- '**.md'
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
env:
CPE_DICTIONARY: https://nvd.nist.gov/feeds/xml/cpe/dictionary/official-cpe-dictionary_v2.3.xml.gz
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Check out FreeBSD Portstree
uses: actions/checkout@v4
with:
repository: freebsd/freebsd-ports
path: ports
- name: Patch portstree
run: |
cp share/*.mk ports/Mk/
cp share/Uses/*.mk ports/Mk/Uses/
- name: Fetch NVD CPE Dictionary
run: wget -qO - ${{ env.CPE_DICTIONARY }} | gunzip -c > data/official-cpe-dictionary_v2.3.xml
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
tools: composer
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install athena-jot bmake sassc parallel
- name: Build chkcpe
run: make
- name: Run chkcpe
env:
MAKESYSPATH: .../share/mk:/home/runner/work/chkcpe/chkcpe/share/mk:/usr/share/mk
PORTSDIR: /home/runner/work/chkcpe/chkcpe/ports
DATADIR: /home/runner/work/chkcpe/chkcpe/data
LOGSDIR: /home/runner/work/chkcpe/chkcpe/logs
CHKCPEDB: sqlite:logs/chkcpe.db
MAKE: /usr/bin/bmake
ARCH: amd64
OPSYS: FreeBSD
OSREL: 13.0
OSVERSION: 1300139
_OSRELEASE: 13.0-RELEASE
MAKE_JOBS_NUMBER: 1
CONFIGURE_MAX_CMD_LEN: 524288
run: |
mkdir logs
sqlite3 logs/chkcpe.db < data/schema.sql
./bin/chkcpe
- name: Upload logfiles
uses: actions/upload-artifact@v4
with:
name: chkcpe.db
path: logs/chkcpe.db
- name: Check out repository wiki
uses: actions/checkout@v4
with:
repository: ${{ github.repository }}.wiki
path: wiki
- name: Upload reports to wiki
run: |
cp -p logs/env logs/*.md wiki/
cd wiki
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git diff-index --quiet HEAD || git commit -m "Add changes" && git push