···2121jobs:
2222 ci-config:
2323 name: config
2424+ 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 }}
···4344 name: check whether CI is enabled for ref
4445 run: |
4546 enabled=yes
4646- if test -x config-repo/ci/config/allow-ref &&
4747- ! config-repo/ci/config/allow-ref '${{ github.ref }}'
4747+ if test -x config-repo/ci/config/allow-ref
4848 then
4949- enabled=no
4949+ echo "::warning::ci/config/allow-ref is deprecated; use CI_BRANCHES instead"
5050+ if ! config-repo/ci/config/allow-ref '${{ github.ref }}'
5151+ then
5252+ enabled=no
5353+ fi
5054 fi
51555256 skip_concurrent=yes
+14
ci/config/README
···11+You can configure some aspects of the GitHub Actions-based CI on a
22+per-repository basis by setting "variables" and "secrets" from with the
33+GitHub web interface. These can be found at:
44+55+ https://github.com/<user>/git/settings/secrets/actions
66+77+The following variables can be used:
88+99+ - CI_BRANCHES
1010+1111+ By default, CI is run when any branch is pushed. If this variable is
1212+ non-empty, then only the branches it lists will run CI. Branch names
1313+ should be separated by spaces, and should use their shortened form
1414+ (e.g., "main", not "refs/heads/main").
-27
ci/config/allow-ref.sample
···11-#!/bin/sh
22-#
33-# Sample script for enabling/disabling GitHub Actions CI runs on
44-# particular refs. By default, CI is run for all branches pushed to
55-# GitHub. You can override this by dropping the ".sample" from the script,
66-# editing it, committing, and pushing the result to the "ci-config" branch of
77-# your repository:
88-#
99-# git checkout -b ci-config
1010-# cp allow-ref.sample allow-ref
1111-# $EDITOR allow-ref
1212-# git add allow-ref
1313-# git commit -am "implement my ci preferences"
1414-# git push
1515-#
1616-# This script will then be run when any refs are pushed to that repository. It
1717-# gets the fully qualified refname as the first argument, and should exit with
1818-# success only for refs for which you want to run CI.
1919-2020-case "$1" in
2121-# allow one-off tests by pushing to "for-ci" or "for-ci/mybranch"
2222-refs/heads/for-ci*) true ;;
2323-# always build your integration branch
2424-refs/heads/my-integration-branch) true ;;
2525-# don't build any other branches or tags
2626-*) false ;;
2727-esac