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

Commit

Permalink
envs can't be accessed inside of 'if'
Browse files Browse the repository at this point in the history
  • Loading branch information
iccub committed Oct 3, 2023
1 parent 37668b0 commit 2f39218
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ on:
pull_request:
types: [ opened, labeled ]

env:
IS_PUSH: ${{ github.event_name == 'push' }}
SKIP_CI: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'CI/skip') }}
LATEST_OS_LABEL: ${{ github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'CI/latest_os' }}
PR_OPENED_WITH_LATEST_OS: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' && contains(github.event.pull_request.labels.*.name, 'CI/latest_os') }}

jobs:
test:
if: >-
env.IS_PUSH ||
(env.SKIP_CI == 'false' && matrix.test_type == 'default') ||
(env.PR_OPENED_WITH_LATEST_OS || env.LATEST_OS_LABEL) && matrix.test_type == 'latest_os'
github.event_name == 'push' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'CI/skip') == false && matrix.test_type == 'default') ||
(github.event_name == 'pull_request' && (github.event.action == 'opened' && contains(github.event.pull_request.labels.*.name, 'CI/latest_os') || github.event.action == 'labeled' && github.event.label.name == 'CI/latest_os') && matrix.test_type == 'latest_os')
name: Run ${{ matrix.test_name }}
runs-on: macOS-13
Expand Down

0 comments on commit 2f39218

Please sign in to comment.