-
Notifications
You must be signed in to change notification settings - Fork 2
Add Dependabot and tests for reusable workflows #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tuomas777
merged 6 commits into
main
from
RATY-350-add-dependabot-and-tests-for-workflows
Jun 25, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
30b034b
deps: pin all workflow actions to SHAs
tuomas777 50eb3ea
ci: add dependabot config
tuomas777 4d86370
feat: add new optional inputs to reusable workflows
tuomas777 6e821fc
test: add tests for reusable workflows
tuomas777 e59465b
feat: harden workflows with permissions and persist-credentials
tuomas777 029e68b
chore: add CODEOWNERS file
tuomas777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| groups: | ||
| github-actions: | ||
| patterns: | ||
| - "*" | ||
| cooldown: | ||
| default-days: 7 | ||
| commit-message: | ||
| prefix: "deps" | ||
|
|
||
| - package-ecosystem: "pip" | ||
| directory: "/.github/workflow-test-fixtures/django-api" | ||
| schedule: | ||
| interval: "weekly" | ||
| groups: | ||
| workflow-test-fixtures: | ||
| applies-to: security-updates | ||
| patterns: | ||
| - "*" | ||
| open-pull-requests-limit: 0 | ||
|
|
||
| - package-ecosystem: "uv" | ||
| directory: "/.github/workflow-test-fixtures/django-api-uv" | ||
| schedule: | ||
| interval: "weekly" | ||
| groups: | ||
| workflow-test-fixtures: | ||
| applies-to: security-updates | ||
| patterns: | ||
| - "*" | ||
| open-pull-requests-limit: 0 |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| // No rules enforced — any commit message is accepted. | ||
| // This config exists so that workflows using wagoid/commitlint-github-action | ||
| // do not fail with "no config found" when called from this repository. | ||
| export default { | ||
| rules: {}, | ||
| }; |
1 change: 1 addition & 0 deletions
1
.github/workflow-test-fixtures/django-api-uv/.pre-commit-config.yaml
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| repos: [] |
1 change: 1 addition & 0 deletions
1
.github/workflow-test-fixtures/django-api-uv/config/__init__.py
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
|
|
48 changes: 48 additions & 0 deletions
48
.github/workflow-test-fixtures/django-api-uv/config/settings.py
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import os | ||
| from pathlib import Path | ||
|
|
||
| BASE_DIR = Path(__file__).resolve().parent.parent | ||
|
|
||
| SECRET_KEY = os.environ.get("SECRET_KEY", "compat-secret") | ||
| DEBUG = True | ||
| ALLOWED_HOSTS: list[str] = ["*"] | ||
|
|
||
| INSTALLED_APPS = [ | ||
| "django.contrib.auth", | ||
| "django.contrib.contenttypes", | ||
| "django.contrib.sessions", | ||
| "django.contrib.messages", | ||
| "django.contrib.staticfiles", | ||
| "dummy", | ||
| ] | ||
|
|
||
| MIDDLEWARE = [ | ||
| "django.middleware.security.SecurityMiddleware", | ||
| "django.contrib.sessions.middleware.SessionMiddleware", | ||
| "django.middleware.common.CommonMiddleware", | ||
| "django.middleware.csrf.CsrfViewMiddleware", | ||
| "django.contrib.auth.middleware.AuthenticationMiddleware", | ||
| "django.contrib.messages.middleware.MessageMiddleware", | ||
| ] | ||
|
|
||
| ROOT_URLCONF = "config.urls" | ||
| TEMPLATES: list[dict[str, object]] = [] | ||
| WSGI_APPLICATION = "config.wsgi.application" | ||
|
|
||
| DATABASES = { | ||
| "default": { | ||
| "ENGINE": "django.db.backends.postgresql", | ||
| "NAME": os.environ.get("POSTGRES_DB", "test_db"), | ||
| "USER": os.environ.get("POSTGRES_USER", "test_user"), | ||
| "PASSWORD": os.environ.get("POSTGRES_PASSWORD", "test_password"), | ||
| "HOST": os.environ.get("POSTGRES_HOST", "localhost"), | ||
| "PORT": os.environ.get("POSTGRES_PORT", "5432"), | ||
| } | ||
| } | ||
|
|
||
| LANGUAGE_CODE = "en-us" | ||
| TIME_ZONE = "UTC" | ||
| USE_I18N = True | ||
| USE_TZ = True | ||
| STATIC_URL = "static/" | ||
| DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" | ||
10 changes: 10 additions & 0 deletions
10
.github/workflow-test-fixtures/django-api-uv/config/urls.py
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from django.http import HttpResponse | ||
| from django.urls import path | ||
|
|
||
|
|
||
| def healthz(_request): | ||
| return HttpResponse("ok") | ||
|
|
||
| urlpatterns = [ | ||
| path("healthz/", healthz), | ||
| ] |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import os | ||
|
|
||
| from django.core.wsgi import get_wsgi_application | ||
|
|
||
| os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") | ||
|
|
||
| application = get_wsgi_application() |
Empty file.
15 changes: 15 additions & 0 deletions
15
.github/workflow-test-fixtures/django-api-uv/dummy/migrations/0001_initial.py
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| initial = True | ||
| dependencies: list = [] | ||
| operations = [ | ||
| migrations.CreateModel( | ||
| name="DummyModel", | ||
| fields=[ | ||
| ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
| ("name", models.CharField(max_length=100)), | ||
| ], | ||
| ), | ||
| ] |
Empty file.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from django.db import models | ||
|
|
||
|
|
||
| class DummyModel(models.Model): | ||
| name = models.CharField(max_length=100) | ||
|
|
||
| class Meta: | ||
| app_label = "dummy" |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/usr/bin/env python | ||
| import os | ||
| import sys | ||
|
|
||
|
|
||
| def main() -> None: | ||
| os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") | ||
| from django.core.management import execute_from_command_line | ||
|
|
||
| execute_from_command_line(sys.argv) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
15 changes: 15 additions & 0 deletions
15
.github/workflow-test-fixtures/django-api-uv/pyproject.toml
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| [project] | ||
| name = "workflow-fixture-django-api-uv" | ||
| version = "0.1.0" | ||
| requires-python = ">=3.12" | ||
| dependencies = [ | ||
| "django>=5.2,<6", | ||
| "psycopg2-binary>=2.9", | ||
| ] | ||
|
|
||
| [dependency-groups] | ||
| dev = [ | ||
| "pytest>=8.4", | ||
| "pytest-cov>=6.1", | ||
| "pytest-django>=4.11", | ||
| ] |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [pytest] | ||
| DJANGO_SETTINGS_MODULE = config.settings |
8 changes: 8 additions & 0 deletions
8
.github/workflow-test-fixtures/django-api-uv/tests/test_smoke.py
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import pytest | ||
| from dummy.models import DummyModel | ||
|
|
||
|
|
||
| @pytest.mark.django_db | ||
| def test_db_connection(): | ||
| DummyModel.objects.create(name="test") | ||
| assert DummyModel.objects.count() == 1 |
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
.github/workflow-test-fixtures/django-api/.pre-commit-config.yaml
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| repos: [] |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
|
|
48 changes: 48 additions & 0 deletions
48
.github/workflow-test-fixtures/django-api/config/settings.py
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import os | ||
| from pathlib import Path | ||
|
|
||
| BASE_DIR = Path(__file__).resolve().parent.parent | ||
|
|
||
| SECRET_KEY = os.environ.get("SECRET_KEY", "compat-secret") | ||
| DEBUG = True | ||
| ALLOWED_HOSTS: list[str] = ["*"] | ||
|
|
||
| INSTALLED_APPS = [ | ||
| "django.contrib.auth", | ||
| "django.contrib.contenttypes", | ||
| "django.contrib.sessions", | ||
| "django.contrib.messages", | ||
| "django.contrib.staticfiles", | ||
| "dummy", | ||
| ] | ||
|
|
||
| MIDDLEWARE = [ | ||
| "django.middleware.security.SecurityMiddleware", | ||
| "django.contrib.sessions.middleware.SessionMiddleware", | ||
| "django.middleware.common.CommonMiddleware", | ||
| "django.middleware.csrf.CsrfViewMiddleware", | ||
| "django.contrib.auth.middleware.AuthenticationMiddleware", | ||
| "django.contrib.messages.middleware.MessageMiddleware", | ||
| ] | ||
|
|
||
| ROOT_URLCONF = "config.urls" | ||
| TEMPLATES: list[dict[str, object]] = [] | ||
| WSGI_APPLICATION = "config.wsgi.application" | ||
|
|
||
| DATABASES = { | ||
| "default": { | ||
| "ENGINE": "django.db.backends.postgresql", | ||
| "NAME": os.environ.get("POSTGRES_DB", "test_db"), | ||
| "USER": os.environ.get("POSTGRES_USER", "test_user"), | ||
| "PASSWORD": os.environ.get("POSTGRES_PASSWORD", "test_password"), | ||
| "HOST": os.environ.get("POSTGRES_HOST", "localhost"), | ||
| "PORT": os.environ.get("POSTGRES_PORT", "5432"), | ||
| } | ||
| } | ||
|
|
||
| LANGUAGE_CODE = "en-us" | ||
| TIME_ZONE = "UTC" | ||
| USE_I18N = True | ||
| USE_TZ = True | ||
| STATIC_URL = "static/" | ||
| DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from django.http import HttpResponse | ||
| from django.urls import path | ||
|
|
||
|
|
||
| def healthz(_request): | ||
| return HttpResponse("ok") | ||
|
|
||
| urlpatterns = [ | ||
| path("healthz/", healthz), | ||
| ] |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import os | ||
|
|
||
| from django.core.wsgi import get_wsgi_application | ||
|
|
||
| os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") | ||
|
|
||
| application = get_wsgi_application() |
Empty file.
15 changes: 15 additions & 0 deletions
15
.github/workflow-test-fixtures/django-api/dummy/migrations/0001_initial.py
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| initial = True | ||
| dependencies: list = [] | ||
| operations = [ | ||
| migrations.CreateModel( | ||
| name="DummyModel", | ||
| fields=[ | ||
| ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
| ("name", models.CharField(max_length=100)), | ||
| ], | ||
| ), | ||
| ] |
Empty file.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| from django.db import models | ||
|
|
||
|
|
||
| class DummyModel(models.Model): | ||
| name = models.CharField(max_length=100) | ||
|
|
||
| class Meta: | ||
| app_label = "dummy" |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/usr/bin/env python | ||
| import os | ||
| import sys | ||
|
|
||
|
|
||
| def main() -> None: | ||
| os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings") | ||
| from django.core.management import execute_from_command_line | ||
|
|
||
| execute_from_command_line(sys.argv) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [pytest] | ||
| DJANGO_SETTINGS_MODULE = config.settings |
3 changes: 3 additions & 0 deletions
3
.github/workflow-test-fixtures/django-api/requirements-dev.txt
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| pytest | ||
| pytest-cov | ||
| pytest-django |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Django>=5.2,<6 | ||
| psycopg2-binary>=2.9 |
8 changes: 8 additions & 0 deletions
8
.github/workflow-test-fixtures/django-api/tests/test_smoke.py
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import pytest | ||
| from dummy.models import DummyModel | ||
|
|
||
|
|
||
| @pytest.mark.django_db | ||
| def test_db_connection(): | ||
| DummyModel.objects.create(name="test") | ||
| assert DummyModel.objects.count() == 1 |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "name": "workflow-compat-node-pnpm", | ||
| "private": true, | ||
| "version": "1.0.0", | ||
| "packageManager": "pnpm@11.5.3", | ||
| "scripts": { | ||
| "lint": "echo lint-ok", | ||
| "build": "mkdir -p dist && echo \"console.log('ok')\" > dist/index.js", | ||
| "test:coverage": "mkdir -p coverage && echo '{}' > coverage/coverage-final.json" | ||
| } | ||
| } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "name": "workflow-compat-node-yarn", | ||
| "private": true, | ||
| "version": "1.0.0", | ||
| "scripts": { | ||
| "lint": "echo lint-ok", | ||
| "build": "mkdir -p dist && echo \"console.log('ok')\" > dist/index.js", | ||
| "test:coverage": "mkdir -p coverage && echo '{}' > coverage/coverage-final.json" | ||
| } | ||
| } |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
| # yarn lockfile v1 |
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.