Settings Action that will configure the settings of a GitHub repository.
-
Create a
~/.github/workflows/settings-guard.ymlfile:--- name: settings-guard 'on': schedule: - cron: '42 6 * * *' permissions: {} jobs: settings-action: runs-on: ubuntu-22.04 steps: - uses: 030/settings-action@a27696394dd22683f19303883d8ef275b7287e83 # v0.10.1 env: GH_TOKEN: ${{ secrets.SETTINGS_GUARD }} with: 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 settings_github_workflows_can_approve_pull_request_reviews: true settings_merge_commit: false settings_merge_rebase: false settings_merge_squash: true settings_protect_main_branch: true settings_protect_main_branch_enforce_admins: true settings_protect_main_branch_required_approving_review_count: 1 settings_projects: false settings_wiki: false topics: composite-action,github-project-setup,github-settings,settings-as-code
-
Create a token with read and admin permissions on the repository.
-
Store it as a
SETTINGS_GUARDsecret in the repository settings.
