GitHub: Admin Repositories Settings #9
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
name: 'GitHub: Admin Repositories Settings' | |
on: | |
workflow_dispatch: | |
# Special permissions required for OIDC authentication | |
permissions: | |
id-token: write | |
contents: read | |
actions: read | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
jobs: | |
admin-update-general-repo-settings: | |
name: 'GitHub: Update General Repository Settings' | |
runs-on: ubuntu-latest | |
# Since these are general settings, they only need to be applied once | |
if: ${{ github.ref_name == 'dev' }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
- name: Update General Repository Settings | |
run: | | |
source ./admin/update_repo_settings.sh | |
update_repo_general_settings ${{ github.repository_owner }} | |
echo "::notice::General Settings Updated" | |
admin-update-tf-module-rulesets: | |
name: 'GitHub: Update tf-module Rulesets' | |
runs-on: ubuntu-latest | |
if: ${{ github.ref_name != 'prod' }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
- name: Update tf-module Rulesets | |
run: | | |
source ./admin/update_repo_settings.sh | |
update_tf_module_rulesets ${{ github.repository_owner }} ${{ github.ref_name }} | |
echo "::notice::tf-module ${{ github.ref_name }} Rulesets Updated" | |
admin-update-tf-iac-rulesets: | |
name: 'GitHub: Update tf-iac Rulesets' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref_name }} | |
- name: Update tf-iac Rulesets | |
run: | | |
source ./admin/update_repo_settings.sh | |
update_tf_iac_rulesets ${{ github.repository_owner }} ${{ github.ref_name }} | |
echo "::notice::tf-iac ${{ github.ref_name }} Rulesets Updated" |