Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
cooldown:
default-days: 7
groups:
github-actions-all:
patterns:
- "*"
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
cooldown:
default-days: 7
groups:
pip-all:
patterns:
- "*"
21 changes: 21 additions & 0 deletions .github/workflows/mcvs-pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: MCVS-PR-validation-action
"on":
pull_request:
types:
- edited
- opened
- reopened
- synchronize
workflow_call:
permissions:
contents: read
pull-requests: read
jobs:
MCVS-PR-validation-action:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
persist-credentials: false
- uses: schubergphilis/mcvs-pr-validation-action@12587186ddd0cf2a2acd20495f3b31262af1f610 # v0.2.1
28 changes: 28 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: python
"on": [push, pull_request]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
with:
persist-credentials: false
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: 3.9.18
cache: "pip"
- name: Install development packages as defined in pyproject.toml
run: |
pip install .[dev]
- name: Run tests
run: |
pytest
- name: Type check the code (mypy)
run: |
mypy main.py
- name: Validate pyproject.toml
run: |
validate-pyproject pyproject.toml
24 changes: 24 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
# copied from https://github.com/zizmorcore/zizmor-action#usage-with-github-advanced-security-recommended
# and slightly modified
name: GitHub Actions Security Analysis with zizmor 🌈
"on":
pull_request:
permissions:
contents: read
jobs:
zizmor:
runs-on: ubuntu-24.04
permissions:
security-events: write
contents: read # only needed for private or internal repos
actions: read # only needed for private or internal repos
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run zizmor 🌈
uses: zizmorcore/zizmor-action@6fc4b006235f201fdab3722e17240ab420d580e5 # v0.6.1
with:
minimum-severity: low
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
update-branch-protection-rule.json
.vscode
update-branch-protection-rule.json
46 changes: 28 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
debug: false
description: "Settings Action configures the settings of a GitHub repository."
project: 030/settings-guard
settings_actions_allowed_actions: "selected"
settings_actions_github_owned_allowed: true
settings_actions_verified_allowed: false
settings_actions_patterns_allowed: "030/*"
settings_actions_require_sha_pinning: true
settings_default_workflow_permissions: "read"
settings_delete_branch_on_merge: true
settings_discussions: false
Expand All @@ -41,24 +46,29 @@ jobs:

use the following variables:

| Option | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------------ |
| debug | Enable debug logging |
| description | Change the description of a GitHub repository |
| project | The owner/repo |
| settings_default_workflow_permissions | Set the default workflow permissions to read or write |
| settings_delete_branch_on_merge | Delete a branch on merge or not |
| settings_discussions | Enable the discussions tab or not |
| settings_github_workflows_can_approve_pull_request_reviews | Whether workflows can approve pull requests |
| settings_merge_commit | Enable merge commit |
| settings_merge_rebase | Enable merge request rebase |
| settings_merge_squash | Enable merge request squash |
| settings_protect_main_branch | Protect the main branch or not |
| settings_protect_main_branch_enforce_admins | Enforce branch protection for admins |
| settings_protect_main_branch_required_approving_review_count | The number of approvals that is required before a PR can be merged |
| settings_projects | Whether the project tab should be enabled |
| settings_wiki | Wiki enabled or not |
| topics | The topic(s) that will appear in the about menu of a project |
| Option | Description |
| ------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| debug | Enable debug logging |
| description | Change the description of a GitHub repository |
| project | The owner/repo |
| settings_actions_allowed_actions | Actions permissions: `all`, `local_only`, or `selected`. Use `selected` to allow OWNER + specific non-OWNER actions/reusable workflows |
| settings_actions_github_owned_allowed | When `settings_actions_allowed_actions` is `selected`, whether GitHub-owned actions (e.g. `actions/checkout`) are allowed |
| settings_actions_verified_allowed | When `settings_actions_allowed_actions` is `selected`, whether actions from verified creators are allowed |
| settings_actions_patterns_allowed | When `settings_actions_allowed_actions` is `selected`, comma-separated list of allowed actions/reusable workflows (e.g. `030/*`) |
| settings_actions_require_sha_pinning | Require actions to be pinned to a full-length commit SHA |
| settings_default_workflow_permissions | Set the default workflow permissions to read or write |
| settings_delete_branch_on_merge | Delete a branch on merge or not |
| settings_discussions | Enable the discussions tab or not |
| settings_github_workflows_can_approve_pull_request_reviews | Whether workflows can approve pull requests |
| settings_merge_commit | Enable merge commit |
| settings_merge_rebase | Enable merge request rebase |
| settings_merge_squash | Enable merge request squash |
| settings_protect_main_branch | Protect the main branch or not |
| settings_protect_main_branch_enforce_admins | Enforce branch protection for admins |
| settings_protect_main_branch_required_approving_review_count | The number of approvals that is required before a PR can be merged |
| settings_projects | Whether the project tab should be enabled |
| settings_wiki | Wiki enabled or not |
| topics | The topic(s) that will appear in the about menu of a project |

and create a token with read and admin permissions and store it as a
`SETTINGS_GUARD` variable in the variables menu.
Expand Down
Loading
Loading