Skip to content

Commit 142e7f6

Browse files
committed
json checks
1 parent 68cb7f9 commit 142e7f6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@ concurrency:
2121
jobs:
2222
ci-config:
2323
name: config
24-
if: vars.CI_BRANCHES == '' || contains(vars.CI_BRANCHES, github.ref_name)
24+
if: |
25+
(fromJSON(vars.CI_CONFIG).allow == '' ||
26+
contains(fromJSON(vars.CI_CONFIG).allow, github.ref_name)) &&
27+
(fromJSON(vars.CI_CONFIG).reject == '' ||
28+
!contains(fromJSON(vars.CI_CONFIG).reject, github.ref_name)) &&
29+
(fromJSON(vars.CI_CONFIG).allow-prefix == '' ||
30+
startsWith(github.ref_name, fromJSON(vars.CI_CONFIG).allow-prefix)) &&
31+
(fromJSON(vars.CI_CONFIG).reject-prefix == '' ||
32+
!startsWith(github.ref_name, fromJSON(vars.CI_CONFIG).reject-prefix))
2533
runs-on: ubuntu-latest
2634
outputs:
2735
enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.outputs.enabled }}

ci/config/README

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ GitHub web interface. These can be found at:
66

77
The following variables can be used:
88

9-
- CI_BRANCHES
9+
- CI_CONFIG
10+
11+
...
1012

1113
By default, CI is run when any branch is pushed. If this variable is
1214
non-empty, then only the branches it lists will run CI. Branch names

0 commit comments

Comments
 (0)