ci: allow per-branch config for GitHub Actions
[alt-git.git] / ci / config / allow-refs.sample
blobf157f1945a286516523b3fa7b3e908a390dedfc5
1 #!/bin/sh
3 # Sample script for enabling/disabling GitHub Actions CI runs on
4 # particular refs. By default, CI is run for all branches pushed to
5 # GitHub. You can override this by dropping the ".sample" from the script,
6 # editing it, committing, and pushing the result to the "ci-config" branch of
7 # your repository:
9 # git checkout -b ci-config
10 # cp allow-refs.sample allow-refs
11 # $EDITOR allow-refs
12 # git commit -am "implement my ci preferences"
13 # git push
15 # This script will then be run when any refs are pushed to that repository. It
16 # gets the fully qualified refname as the first argument, and should exit with
17 # success only for refs for which you want to run CI.
19 case "$1" in
20 # allow one-off tests by pushing to "for-ci" or "for-ci/mybranch"
21 refs/heads/for-ci*) true ;;
22 # always build your integration branch
23 refs/heads/my-integration-branch) true ;;
24 # don't build any other branches or tags
25 *) false ;;
26 esac