Skip to content

build

build #2

Workflow file for this run

name: Build
on:
repository_dispatch:
types: [build]
env:
ALLOWED_REPOS: '["frontend-react", "frontend-next", "cover-router", "dummy-app"]'
ALLOWED_BRANCHES: '["dev", "master"]'
TARGET_REPO: ${{ github.event.client_payload.repo || 'none' }}
TARGET_BRANCH: ${{ github.event.client_payload.branch || 'none' }}
jobs:
check-calling-repo:
runs-on: ubuntu-22.04
environment: production
timeout-minutes: 5
steps:
- name: print-gh
run: echo gh '${{ toJSON(github) }}'
- name: print-env
run: echo env '${{ toJSON(env) }}'
- name: print-vars
run: echo vars '${{ toJSON(vars) }}'
- name: print-secrets
run: echo secrets '${{ toJSON(secrets) }}'
- name: check repos
if: ${{ ! contains(fromJSON(env.ALLOWED_REPOS), env.TARGET_REPO) }}
run: exit 2 # making it fail if the repo is not allowed
- name: check branch
if: ${{ ! contains(fromJSON(env.ALLOWED_BRANCHES), env.TARGET_BRANCH) }}
run: exit 1 # making it fail if the branch is not allowed