diff --git a/.github/workflows/newcheck.yml b/.github/workflows/newcheck.yml index 448ad040342..695456bdbc8 100644 --- a/.github/workflows/newcheck.yml +++ b/.github/workflows/newcheck.yml @@ -13,15 +13,18 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 - - - + + - name: Get branch protection rule + run: | + curl -L \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer $G_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/$REPO_NAME/branches/$BRANCH_NAME/protection/required_status_checks/contexts - name: Add branch protection rule run: | tail -n +2 .github/workflows/check.csv | while IFS=, read -r REPO_NAME BRANCH_NAME CHECKS; do - set -x # Enable debugging - curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \