Skip to content

Commit 32de857

Browse files
committed
Merge branch 'jk/ci-retire-allow-ref'
CI update. * jk/ci-retire-allow-ref: ci: deprecate ci/config/allow-ref script ci: allow branch selection through "vars"
2 parents 300b2a1 + edf80d2 commit 32de857

File tree

3 files changed

+21
-30
lines changed

3 files changed

+21
-30
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ concurrency:
2121
jobs:
2222
ci-config:
2323
name: config
24+
if: vars.CI_BRANCHES == '' || contains(vars.CI_BRANCHES, github.ref_name)
2425
runs-on: ubuntu-latest
2526
outputs:
2627
enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.outputs.enabled }}
@@ -43,10 +44,13 @@ jobs:
4344
name: check whether CI is enabled for ref
4445
run: |
4546
enabled=yes
46-
if test -x config-repo/ci/config/allow-ref &&
47-
! config-repo/ci/config/allow-ref '${{ github.ref }}'
47+
if test -x config-repo/ci/config/allow-ref
4848
then
49-
enabled=no
49+
echo "::warning::ci/config/allow-ref is deprecated; use CI_BRANCHES instead"
50+
if ! config-repo/ci/config/allow-ref '${{ github.ref }}'
51+
then
52+
enabled=no
53+
fi
5054
fi
5155
5256
skip_concurrent=yes

ci/config/README

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
You can configure some aspects of the GitHub Actions-based CI on a
2+
per-repository basis by setting "variables" and "secrets" from with the
3+
GitHub web interface. These can be found at:
4+
5+
https://github.com/<user>/git/settings/secrets/actions
6+
7+
The following variables can be used:
8+
9+
- CI_BRANCHES
10+
11+
By default, CI is run when any branch is pushed. If this variable is
12+
non-empty, then only the branches it lists will run CI. Branch names
13+
should be separated by spaces, and should use their shortened form
14+
(e.g., "main", not "refs/heads/main").

ci/config/allow-ref.sample

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)