From 70a8540678202287ca6e7940826bdeb32f16b5d7 Mon Sep 17 00:00:00 2001 From: Rakshith B <79500257+Rakshithb1@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:59:44 +0530 Subject: [PATCH] Update add-checks.yml Signed-off-by: Rakshith B <79500257+Rakshithb1@users.noreply.github.com> --- .github/workflows/add-checks.yml | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/.github/workflows/add-checks.yml b/.github/workflows/add-checks.yml index 5f1815115c2..3246767704c 100644 --- a/.github/workflows/add-checks.yml +++ b/.github/workflows/add-checks.yml @@ -13,34 +13,13 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Create branch protection - run: | - BRANCH_NAME="develop" - GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} - - # Get the repository information - REPO_OWNER="Rakshithb1" - REPO_NAME="commons" - # Create a branch protection rule using GitHub API - curl -X PUT \ - -H "Authorization: Bearer $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/branches/$BRANCH_NAME/protection" \ - -d '{ - "required_status_checks": { - "enforcement_level": "strict", - "contexts": ["kernel-idgenerator-service / build-dockers"] - } - }' - name: Add branch protection rule run: | - - curl -X POST \ - + curl -L \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: token ${{ secrets.TOKEN }}" \ + -H "Authorization: Bearer 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" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/Rakshithb1/commons/branches/develop/protection/required_status_checks/contexts \ - -d '{"contexts":["kernel-idgenerator-service / build-dockers","kernel-notification-service / build-dockers"]}' + https://api.github.com/repos/Rakshithb1/commons/branches/develop/protection/required_status_checks +