Skip to content

Commit

Permalink
Add ruleset for main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
philnewm committed Sep 24, 2024
1 parent 212df5b commit c12a9ee
Showing 1 changed file with 47 additions and 11 deletions.
58 changes: 47 additions & 11 deletions .github/workflows/reset_test_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,25 +201,61 @@ jobs:
-f ref="refs/heads/${{ env.MAIN_BRANCH }}" \
-f sha="${{ steps.latest-sha.outputs.sha }}"
- name: Apply branch protection rules for 'main'
- name: Apply branch protection rules for '${{ env.MAIN_BRANCH }}'
run: |
curl -O https://raw.githubusercontent.com/${{ github.repository }}/main/branch_rules/protect_main.json
gh api \
--method PUT \
--method POST \
-H "Accept: application/vnd.github+json" \
/repos/${{ env.TARGET_REPO }}/branches/main/protection \
--input protect_main.json
rm protect_main.json
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/ynput/ayon-addon-action-testing/rulesets \
-f "name=Protect main" \
-f "target=branch" \
-f "enforcement=active" \
-f "conditions[ref_name][include][]=refs/heads/main" \
-f "conditions[ref_name][exclude][]" \
-f "rules[][type]=deletion" \
-f "rules[][type]=non_fast_forward" \
-f "rules[][type]=creation" \
-f "rules[][type]=update" \
-F "bypass_actors[][actor_id]=10997209" \
-f "bypass_actors[][actor_type]=Team" \
-f "bypass_actors[][bypass_mode]=always"
# - name: Apply branch protection rules for 'develop'
# run: |
# curl -O https://raw.githubusercontent.com/${{ github.repository }}/main/branch_rules/protect_develop.json
# gh api \
# --method PUT \
# --method POST \
# -H "Accept: application/vnd.github+json" \
# /repos/${{ env.TARGET_REPO }}/branches/develop/protection \
# --input develop-branch-rules.json
# rm protect_develop.json
# -H "X-GitHub-Api-Version: 2022-11-28" \
# /repos/ynput/ayon-addon-action-testing/rulesets \
# -f "name=Protect develop" \
# -f "target=branch" \
# -f "enforcement=active" \
# -f "conditions[ref_name][include][]=refs/heads/develop" \
# -f "conditions[ref_name][exclude][]" \
# -f "rules[][type]=deletion" \
# -f "rules[][type]=non_fast_forward" \
# -f "rules[][type]=required_status_checks" \
# -f "rules[][parameters][strict_required_status_checks_policy]=true" \
# -f "rules[][parameters][do_not_enforce_on_create]=false" \
# -f "rules[][parameters][required_status_checks][]" \
# -f "rules[][parameters][required_status_checks][0][context]=linting" \
# -f "rules[][parameters][required_status_checks][0][integration_id]=15368" \
# -f "rules[][type]=pull_request" \
# -f "rules[][parameters][required_approving_review_count]=1" \
# -f "rules[][parameters][dismiss_stale_reviews_on_push]=false" \
# -f "rules[][parameters][require_code_owner_review]=true" \
# -f "rules[][parameters][require_last_push_approval]=false" \
# -f "rules[][parameters][required_review_thread_resolution]=false" \
# -F "bypass_actors[][actor_id]=5" \
# -f "bypass_actors[][actor_type]=RepositoryRole" \
# -f "bypass_actors[][bypass_mode]=always" \
# -F "bypass_actors[][actor_id]=10997209" \
# -f "bypass_actors[][actor_type]=Team" \
# -f "bypass_actors[][bypass_mode]=always" \
# -F "bypass_actors[][actor_id]=1" \
# -f "bypass_actors[][actor_type]=OrganizationAdmin" \
# -f "bypass_actors[][bypass_mode]=always"


prepare-release:
Expand Down

0 comments on commit c12a9ee

Please sign in to comment.