From c3e6b2b3fd85ba84b06fedd44b5377268ea25bc1 Mon Sep 17 00:00:00 2001 From: Alexander Lobyntsev Date: Mon, 13 Nov 2023 12:29:17 +0700 Subject: [PATCH] ci: add auth workflow [no ci] --- .github/workflows/auth.yml | 15 +++++++++++++++ .github/workflows/publish-canary.yml | 9 ++------- 2 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/auth.yml diff --git a/.github/workflows/auth.yml b/.github/workflows/auth.yml new file mode 100644 index 00000000..9c9474f3 --- /dev/null +++ b/.github/workflows/auth.yml @@ -0,0 +1,15 @@ +name: Reusable workflow (Authorize) + +on: + workflow_call: + +jobs: + authorize: + runs-on: ubuntu-latest + environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} + + steps: + - name: Echo + run: | + echo "External pull request approved by code owners" + diff --git a/.github/workflows/publish-canary.yml b/.github/workflows/publish-canary.yml index 3caf786a..00769028 100644 --- a/.github/workflows/publish-canary.yml +++ b/.github/workflows/publish-canary.yml @@ -10,13 +10,8 @@ on: jobs: authorize: - runs-on: ubuntu-latest - environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} - - steps: - - name: Echo - run: | - echo "External pull request approved by code owners" + name: Authorize external pull request + uses: ./.github/workflows/auth.yml publish: name: Canary version