Skip to content

Commit d74df8e

Browse files
authored
ci: add Dependabot config, update GitHub Actions workflows with pinned versions, add security policy, and bump project version to 1.1.0 (#23)
1 parent b835663 commit d74df8e

8 files changed

Lines changed: 98 additions & 25 deletions

File tree

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
commit-message:
8+
prefix: "ci"
9+
labels:
10+
- "dependencies"
11+
- "github-actions"
12+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
pull_request:
66
push:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
test:
1013
name: Test (Python ${{ matrix.python-version }}, Django ${{ matrix.django-name }})
@@ -47,23 +50,23 @@ jobs:
4750
django-name: "5.2"
4851
django-constraint: "django>=5.2,<5.3"
4952
steps:
50-
- uses: actions/checkout@v4
51-
- uses: actions/setup-python@v5
53+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
54+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
5255
with:
5356
python-version: "${{ matrix.python-version }}"
54-
- uses: astral-sh/setup-uv@v5
57+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
5558
- name: Run tests
5659
run: make test-django PYTHON=${{ matrix.python-version }} DJANGO_CONSTRAINT='${{ matrix.django-constraint }}'
5760

5861
lint:
5962
name: Lint
6063
runs-on: ubuntu-latest
6164
steps:
62-
- uses: actions/checkout@v4
63-
- uses: actions/setup-python@v5
65+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
66+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
6467
with:
6568
python-version: "3.13"
66-
- uses: astral-sh/setup-uv@v5
69+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
6770
- name: Sync dependencies
6871
run: make sync
6972
- name: Run lint
@@ -73,10 +76,10 @@ jobs:
7376
name: Package Check
7477
runs-on: ubuntu-latest
7578
steps:
76-
- uses: actions/checkout@v4
77-
- uses: actions/setup-python@v5
79+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
80+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
7881
with:
7982
python-version: "3.13"
80-
- uses: astral-sh/setup-uv@v5
83+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
8184
- name: Build package
8285
run: make build
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Dependency Review
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
dependency-review:
11+
name: Dependency Review
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
15+
- name: Review dependency changes
16+
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
17+
with:
18+
fail-on-severity: moderate

.github/workflows/production.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
tags:
66
- "v*"
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
metadata:
1013
name: Release Metadata
@@ -13,7 +16,7 @@ jobs:
1316
package_version: ${{ steps.version.outputs.package_version }}
1417
git_tag: ${{ steps.version.outputs.git_tag }}
1518
steps:
16-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1720
- name: Read package version
1821
id: version
1922
run: |
@@ -44,17 +47,17 @@ jobs:
4447
permissions:
4548
contents: read
4649
steps:
47-
- uses: actions/checkout@v4
48-
- uses: actions/setup-python@v5
50+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
4952
with:
5053
python-version: "3.13"
51-
- uses: astral-sh/setup-uv@v5
54+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
5255
- name: Sync dependencies
5356
run: make sync
5457
- name: Build package
5558
run: make build
5659
- name: Upload distribution artifacts
57-
uses: actions/upload-artifact@v4
60+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5861
with:
5962
name: dist-${{ needs.metadata.outputs.package_version }}
6063
path: dist/*
@@ -70,11 +73,11 @@ jobs:
7073
environment: pypi
7174
steps:
7275
- name: Download distribution artifacts
73-
uses: actions/download-artifact@v4
76+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
7477
with:
7578
name: dist-${{ needs.metadata.outputs.package_version }}
7679
path: dist
7780
- name: Publish package
78-
uses: pypa/gh-action-pypi-publish@release/v1
81+
uses: pypa/gh-action-pypi-publish@106e0b0b7c337fa67ed433972f777c6357f78598 # v1.13.0
7982
with:
8083
packages-dir: dist

.github/workflows/publish-to-test-pypi.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ name: Publish 📦 to PyPI test server 🐍
33
on:
44
workflow_dispatch:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
metadata:
811
name: Release Metadata
912
runs-on: ubuntu-latest
1013
outputs:
1114
package_version: ${{ steps.version.outputs.package_version }}
1215
steps:
13-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1417
- name: Read package version
1518
id: version
1619
run: |
@@ -36,17 +39,17 @@ jobs:
3639
permissions:
3740
contents: read
3841
steps:
39-
- uses: actions/checkout@v4
40-
- uses: actions/setup-python@v5
42+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
43+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
4144
with:
4245
python-version: "3.13"
43-
- uses: astral-sh/setup-uv@v5
46+
- uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
4447
- name: Sync dependencies
4548
run: make sync
4649
- name: Build package
4750
run: make build
4851
- name: Upload distribution artifacts
49-
uses: actions/upload-artifact@v4
52+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5053
with:
5154
name: dist-${{ needs.metadata.outputs.package_version }}
5255
path: dist/*
@@ -62,12 +65,12 @@ jobs:
6265
environment: testpypi
6366
steps:
6467
- name: Download distribution artifacts
65-
uses: actions/download-artifact@v4
68+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
6669
with:
6770
name: dist-${{ needs.metadata.outputs.package_version }}
6871
path: dist
6972
- name: Publish package
70-
uses: pypa/gh-action-pypi-publish@release/v1
73+
uses: pypa/gh-action-pypi-publish@106e0b0b7c337fa67ed433972f777c6357f78598 # v1.13.0
7174
with:
7275
packages-dir: dist
7376
repository-url: https://test.pypi.org/legacy/

SECURITY.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Security Policy
2+
3+
## Supported Release Process
4+
5+
This project follows a tag-driven release process for production publishing:
6+
7+
- CI runs on pull requests and pushes
8+
- production publishing runs only from tags matching `vX.Y.Z`
9+
- the release workflow validates that the Git tag matches `project.version`
10+
- production and TestPyPI publishing use Trusted Publishing with GitHub OIDC
11+
- release artifacts are built in CI and published from those exact artifacts
12+
13+
## Reporting a Vulnerability
14+
15+
Please do not open a public issue for suspected security vulnerabilities.
16+
17+
Instead:
18+
19+
1. Contact the maintainers privately.
20+
2. Include a clear description of the issue, affected versions, impact, and reproduction steps.
21+
3. If possible, include a proposed fix or mitigation.
22+
23+
Until a dedicated private reporting channel is published for this repository, use the maintainer contact listed in `pyproject.toml`.
24+
25+
## Supply Chain Controls
26+
27+
This repository uses several controls intended to reduce supply-chain risk:
28+
29+
- third-party GitHub Actions are pinned to immutable commit SHAs
30+
- pull requests run dependency review checks
31+
- publishing is gated by CI and uses Trusted Publishing
32+
- GitHub Actions dependency updates are handled through Dependabot
33+
34+
These controls reduce risk, but they do not eliminate it. Review dependency changes and release workflow changes carefully.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "django-dbml"
7-
version = "1.0.1"
7+
version = "1.1.0"
88
description = "Django extension aimed to generate DBML from installed models."
99
readme = "README.md"
1010
requires-python = ">=3.11"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)