Ingest Cloud OSV #13586
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ingest Cloud OSV | |
on: | |
schedule: | |
- cron: '*/30 * * * *' # Every hour | |
workflow_dispatch: | |
permissions: read-all | |
jobs: | |
ingest-osv: | |
name: Ingest Cloud OSV | |
continue-on-error: false | |
runs-on: ubuntu-latest | |
timeout-minutes: 45 # Don't allow the job to run too long. | |
permissions: | |
actions: read | |
contents: write | |
steps: | |
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | |
with: | |
go-version: "1.21" | |
# gocloud has an issue where it requires an ADC file to work with GCS, even | |
# for anonymous requests. This change tricks the auth code into succeeding. | |
- name: GCP Credential Workaround | |
run: | | |
echo '{ "type": "service_account" }' > .dummy_adc.json | |
- name: Ingest OSV | |
run: | | |
go run ./cmd/ingest -config config/config.yaml -start-keys config/start-keys.yaml | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: .dummy_adc.json | |
- name: Prepare commit | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
git add osv config/start-keys.yaml | |
- name: Commit report changes | |
run: git diff --cached --quiet || git commit -m 'Ingest OSV - Cloud Storage' | |
- name: Push commit | |
run: git push |