From fd0120d98b06f4284b0c39a06674a93bfd32bf0d Mon Sep 17 00:00:00 2001 From: Mika Ayenson Date: Fri, 24 Feb 2023 09:17:07 -0500 Subject: [PATCH] [FR] Use Read token on branch status checks (#2598) --- .github/workflows/backport.yml | 2 +- .github/workflows/branch-status-checks.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 32a2dcfdd..71331d20d 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -69,6 +69,7 @@ jobs: with: token: ${{ secrets.PROTECTIONS_MACHINE_TOKEN }} ref: main + fetch-depth: 100 - name: Set github config run: | @@ -77,7 +78,6 @@ jobs: - name: Get branch histories run: | - git fetch origin main --depth 100 git fetch origin ${{matrix.target_branch}} --depth 1 git status git log -1 --format='%H' diff --git a/.github/workflows/branch-status-checks.yml b/.github/workflows/branch-status-checks.yml index 7d2a3ae29..630dfe5e6 100644 --- a/.github/workflows/branch-status-checks.yml +++ b/.github/workflows/branch-status-checks.yml @@ -22,6 +22,7 @@ jobs: with: url: "https://api.github.com/repos/elastic/detection-rules/actions/workflows/pythonpackage.yml/runs?per_page=1&branch=${{matrix.target_branch}}" method: 'GET' + bearerToken: ${{ secrets.READ_ORG_TOKEN }} - name: Check Backport Status uses: actions/github-script@v6