ci: deprecate ci/config/allow-ref script

Now that we have the CI_BRANCHES mechanism, there is no need for anybody to use the ci/config/allow-ref mechanism. In the long run, we can hopefully remove it and the whole "config" job, as it consumes CPU and adds to the end-to-end latency of the whole workflow. But we don't want to do that immediately, as people need time to migrate until the CI_BRANCHES change has made it into the workflow file of every branch. So let's issue a warning, which will appear in the "annotations" section below the workflow result in GitHub's web interface. And let's remove the sample allow-refs script, as we don't want to encourage anybody to use it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Aug 30, 2023 at 15:51 UTC edf80d23f1e945646a873dc9a4fa6634dd9e8ae8
2 files changed +6 -30
.github/workflows/main.yml
+6 -3
@@ -31,10 +31,13 @@ jobs:
31 name: check whether CI is enabled for ref
32 run: |
33 enabled=yes
34 - if test -x config-repo/ci/config/allow-ref &&
35 - ! config-repo/ci/config/allow-ref '${{ github.ref }}'
34 + if test -x config-repo/ci/config/allow-ref
35 then
37 - enabled=no
36 + echo "::warning::ci/config/allow-ref is deprecated; use CI_BRANCHES instead"
37 + if ! config-repo/ci/config/allow-ref '${{ github.ref }}'
38 + then
39 + enabled=no
40 + fi
41 fi
42
43 skip_concurrent=yes
ci/config/allow-ref.sample deleted
-27
@@ -1,27 +0,0 @@
1 -#!/bin/sh
2 -#
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:
8 -#
9 -# git checkout -b ci-config
10 -# cp allow-ref.sample allow-ref
11 -# $EDITOR allow-ref
12 -# git add allow-ref
13 -# git commit -am "implement my ci preferences"
14 -# git push
15 -#
16 -# This script will then be run when any refs are pushed to that repository. It
17 -# gets the fully qualified refname as the first argument, and should exit with
18 -# success only for refs for which you want to run CI.
19 -
20 -case "$1" in
21 -# allow one-off tests by pushing to "for-ci" or "for-ci/mybranch"
22 -refs/heads/for-ci*) true ;;
23 -# always build your integration branch
24 -refs/heads/my-integration-branch) true ;;
25 -# don't build any other branches or tags
26 -*) false ;;
27 -esac