Skip to content

Commit 79b7530

Browse files
ci: add Release Drafter, semantic PR check, Dependabot + labels (#3)
1 parent badeee1 commit 79b7530

File tree

9 files changed

+150
-0
lines changed

9 files changed

+150
-0
lines changed

.github/dependabot.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
time: "04:00"
9+
timezone: "Europe/Lisbon"
10+
open-pull-requests-limit: 10
11+
labels: ["deps","ci"]
12+
- package-ecosystem: "pip"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"
16+
day: "monday"
17+
time: "04:15"
18+
timezone: "Europe/Lisbon"
19+
open-pull-requests-limit: 10
20+
labels: ["deps","python"]
21+
versioning-strategy: increase-if-necessary

.github/release-drafter.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name-template: 'v$NEXT_PATCH_VERSION'
2+
tag-template: 'v$NEXT_PATCH_VERSION'
3+
change-template: '- $TITLE (#$NUMBER)'
4+
no-changes-template: 'No user-facing changes.'
5+
6+
categories:
7+
- title: '🚀 Features'
8+
labels: ['feat','feature','enhancement']
9+
- title: '🐛 Fixes'
10+
labels: ['fix','bug','bugfix']
11+
- title: '🧰 Chores'
12+
labels: ['chore','build','deps']
13+
- title: '📚 Docs'
14+
labels: ['docs']
15+
- title: '🧪 CI'
16+
labels: ['ci']
17+
18+
version-resolver:
19+
major:
20+
labels: ['major']
21+
minor:
22+
labels: ['minor','feat']
23+
patch:
24+
labels: ['patch','fix','chore','docs','ci','build','deps']
25+
default: patch
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: dependabot metadata and labels
2+
on:
3+
pull_request_target:
4+
types: [opened, edited, synchronize, reopened]
5+
6+
permissions:
7+
pull-requests: write
8+
contents: read
9+
10+
jobs:
11+
label:
12+
if: github.actor == 'dependabot[bot]'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- id: meta
16+
uses: dependabot/fetch-metadata@v2
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}
19+
- name: Apply labels
20+
uses: actions/github-script@v7
21+
with:
22+
script: |
23+
const core = require('@actions/core');
24+
const sev = core.getInput('severity');
25+
const ecosys = core.getInput('package-ecosystem');
26+
const labels = new Set(['deps']);
27+
if (ecosys) labels.add(`deps:${ecosys}`);
28+
if (sev) labels.add(`security:${sev.toLowerCase()}`);
29+
await github.rest.issues.addLabels({
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
issue_number: context.payload.pull_request.number,
33+
labels: Array.from(labels)
34+
});
35+
env:
36+
severity: ${{ steps.meta.outputs.security-advisory-severity }}
37+
package-ecosystem: ${{ steps.meta.outputs.package-ecosystem }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release Drafter
2+
on:
3+
push:
4+
branches: [ "main" ]
5+
pull_request:
6+
types: [opened, edited, reopened, synchronize, ready_for_review, labeled, unlabeled, closed]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
13+
jobs:
14+
update:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: release-drafter/release-drafter@v6
18+
with:
19+
config-name: release-drafter.yml
20+
env:
21+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/semantic-pr.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: semantic PR title
2+
on:
3+
pull_request_target:
4+
types: [opened, edited, synchronize, reopened, ready_for_review]
5+
6+
permissions:
7+
pull-requests: read
8+
statuses: write
9+
10+
jobs:
11+
check:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: amannn/action-semantic-pull-request@v5
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
with:
18+
types: |
19+
chore
20+
ci
21+
docs
22+
feat
23+
fix
24+
perf
25+
refactor
26+
test
27+
build
28+
requireScope: false
29+
subjectPattern: ^.+$
30+
wip: true

_ci_logs/black.post.yml.log

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
All done! ✨ 🍰 ✨
2+
9 files would be left unchanged.

_ci_logs/mypy.post.yml.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Success: no issues found in 3 source files

_ci_logs/pytest.post.yml.log

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
............. [100%]
2+
3+
---------- coverage: platform linux, python 3.12.6-final-0 -----------
4+
Name Stmts Miss Cover Missing
5+
--------------------------------------------------------------
6+
src/osv_vuln_bot/__init__.py 2 0 100%
7+
src/osv_vuln_bot/cli.py 41 0 100%
8+
src/osv_vuln_bot/osv_client.py 73 4 95% 53-54, 72-73
9+
--------------------------------------------------------------
10+
TOTAL 116 4 97%
11+
12+
Required test coverage of 95% reached. Total coverage: 96.55%

_ci_logs/ruff.post.yml.log

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
All checks passed!

0 commit comments

Comments
 (0)