Skip to content

Commit

Permalink
json checks
Browse files Browse the repository at this point in the history
  • Loading branch information
peff committed Nov 25, 2024
1 parent 6ea2d9d commit 9f00845
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ concurrency:
jobs:
ci-config:
name: config
if: vars.CI_BRANCHES == '' || contains(vars.CI_BRANCHES, github.ref_name)
if: |
(fromJSON(vars.CI_CONFIG).allow == '' ||
contains(fromJSON(vars.CI_CONFIG).allow, github.ref_name)) &&
(fromJSON(vars.CI_CONFIG).reject == '' ||
!contains(fromJSON(vars.CI_CONFIG).reject, github.ref_name)) &&
(fromJSON(vars.CI_CONFIG).allow-prefix == '' ||
startsWith(github.ref_name, fromJSON(vars.CI_CONFIG).allow-prefix)) &&
(fromJSON(vars.CI_CONFIG).reject-prefix == '' ||
!startsWith(github.ref_name, fromJSON(vars.CI_CONFIG).reject-prefix))
runs-on: ubuntu-latest
outputs:
enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.outputs.enabled }}
Expand Down
4 changes: 3 additions & 1 deletion ci/config/README
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ GitHub web interface. These can be found at:

The following variables can be used:

- CI_BRANCHES
- CI_CONFIG

...

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

0 comments on commit 9f00845

Please sign in to comment.