Skip to content

Commit f2e0637

Browse files
committed
ci: periodic security identifier allocation workflow
Also migrates to runs-on for runners Signed-off-by: Weston Steimel <author@code.w.steimel.me.uk>
1 parent 560720c commit f2e0637

File tree

4 files changed

+53
-1
lines changed

4 files changed

+53
-1
lines changed

.github/runs-on.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# runs-on.com runner configuration
2+
3+
# defer to the https://github.com/anchore/workflows repository for private runner configs
4+
_extends: workflows

.github/workflows/allocate.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "Allocate Security Identifiers"
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '12 * * * MON-FRI'
6+
7+
concurrency:
8+
group: allocate-security-identifiers
9+
cancel-in-progress: true
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
allocate-security-identifiers:
16+
name: "Allocate Security Identfiers"
17+
runs-on: runs-on: runs-on=${{ github.run_id }}/runner=medium-arm
18+
container:
19+
image: python:3.13-alpine
20+
permissions:
21+
contents: write
22+
steps:
23+
- name: Install OS dependencies
24+
run: apk add --no-cache git taplo sqlite tar zstd curl oras-cli bash date grype
25+
- name: Configure git
26+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
27+
- name: Install python dependencies
28+
run: pip install check-jsonschema cpe git+https://github.com/anchore/security-cli
29+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
30+
- name: Allocate security identifiers
31+
run: anchore-security-cli id allocate --data-path data
32+
- name: Run TOML formatting
33+
run: taplo format
34+
- name: Run TOML schema validation
35+
run: taplo validate --schema file:${PWD}/schema/0.1.0.schema.json
36+
- name: Run TOML formatting validation
37+
run: taplo format --check
38+
- name: Commit changes
39+
run: |
40+
git config user.email "github-actions[bot]@users.noreply.github.com"
41+
git config user.name "github-actions[bot]"
42+
./scripts/commit.sh
43+
git push

.github/workflows/validations.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414
jobs:
1515
validate-schema:
1616
name: "Validate Schema"
17-
runs-on: ubuntu-latest
17+
runs-on: runs-on: runs-on=${{ github.run_id }}/runner=small-arm
1818
container:
1919
image: python:3.13-alpine
2020
permissions:

scripts/commit.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash -l
2+
3+
git add .
4+
date=$(date -I)
5+
git diff-index --quiet HEAD || git commit --message "allocate security identifiers: ${date}"

0 commit comments

Comments
 (0)