Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
cannot embed json refs inside contains(fromJSON()) so might as well h…
Browse files Browse the repository at this point in the history
…ardcode the list

Signed-off-by: RHDH Build (rhdh-bot) <rhdh-bot@redhat.com>
  • Loading branch information
rhdh-bot committed Jan 4, 2024
1 parent 6f28789 commit 906d808
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions .github/workflows/pr-docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,32 +32,14 @@ env:
REGISTRY: quay.io

jobs:
get-owners:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: read-yaml-file
uses: pietrobolcato/action-read-yaml@1.1.0
id: read_action_js
with:
config: ${{ github.workspace }}/OWNERS
# - name: use-owners
# run: |
# echo "approvers.0: ${{ steps.read_action_js.outputs['approvers.0'] }}"
# echo "approvers.1: ${{ steps.read_action_js.outputs['approvers.1'] }}"
# echo "approvers.2: ${{ steps.read_action_js.outputs['approvers.2'] }}"
# echo "approvers.3: ${{ steps.read_action_js.outputs['approvers.3'] }}"
# echo "approvers.4: ${{ steps.read_action_js.outputs['approvers.4'] }}"

authorize:
# The 'external' environment is configured with the odo-maintainers team as required reviewers.
# All the subsequent jobs in this workflow 'need' this job, which will require manual approval for PRs coming from external forks.
# see list of approvers in OWNERS file
environment:
${{ (github.event.pull_request.head.repo.full_name == github.repository ||
contains(fromJSON('[steps.read_action_js.outputs['approvers.0'], steps.read_action_js.outputs['approvers.1'], steps.read_action_js.outputs['approvers.2'], steps.read_action_js.outputs['approvers.3'], steps.read_action_js.outputs['approvers.4']]'), github.actor)) && 'internal' || 'external' }}
contains(fromJSON('["gazarenkov","jianrongzhang89","kadel","nickboldt","rm3l"]'), github.actor)) && 'internal' || 'external' }}
runs-on: ubuntu-latest
needs: get-owners
steps:
- name: approved
run: |
Expand All @@ -66,7 +48,7 @@ jobs:
pr-docker-build:
name: PR Docker Build
runs-on: ubuntu-latest
needs: [get-owners, authorize]
needs: authorize
permissions:
contents: read
packages: write
Expand Down

0 comments on commit 906d808

Please sign in to comment.