34 lines
1.2 KiB
YAML
34 lines
1.2 KiB
YAML
name: Alpine Security Database Mirror
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "07 */6 * * *"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
mirror:
|
|
runs-on: vuln-runner
|
|
timeout-minutes: 180
|
|
steps:
|
|
- name: Alpine secdb synchronisieren
|
|
env:
|
|
GITEA_JOB_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
CACHE_ROOT: /var/lib/act_runner/cache/vuln-alpine
|
|
REPO_URL: https://git.apex-project.de/VULN/vuln-alpine.git
|
|
run: |
|
|
set -Eeuo pipefail
|
|
mkdir -p "$CACHE_ROOT"
|
|
# Bootstrap is embedded to avoid a second checkout just to read a shell script.
|
|
if [[ ! -d "$CACHE_ROOT/repo/.git" ]]; then
|
|
: "${GITEA_JOB_TOKEN:?GITEA_TOKEN fehlt}"
|
|
fi
|
|
AUTH_HEADER="Authorization: Basic $(printf 'oauth2:%s' "$GITEA_JOB_TOKEN" | base64 | tr -d '\n')"
|
|
export GIT_CONFIG_COUNT=1
|
|
export GIT_CONFIG_KEY_0=http.extraheader
|
|
export GIT_CONFIG_VALUE_0="$AUTH_HEADER"
|
|
export GIT_TERMINAL_PROMPT=0
|
|
if [[ ! -d "$CACHE_ROOT/repo/.git" ]]; then
|
|
git clone --depth 1 --branch main "$REPO_URL" "$CACHE_ROOT/repo"
|
|
fi
|
|
bash "$CACHE_ROOT/repo/scripts/run-cached.sh"
|