Git fork

Merge branch 'jk/ci-retire-allow-ref' into maint-2.42

CI update.

* jk/ci-retire-allow-ref:
ci: deprecate ci/config/allow-ref script
ci: allow branch selection through "vars"

+21 -30
+7 -3
.github/workflows/main.yml
··· 21 21 jobs: 22 22 ci-config: 23 23 name: config 24 + if: vars.CI_BRANCHES == '' || contains(vars.CI_BRANCHES, github.ref_name) 24 25 runs-on: ubuntu-latest 25 26 outputs: 26 27 enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.outputs.enabled }} ··· 43 44 name: check whether CI is enabled for ref 44 45 run: | 45 46 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 48 48 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 50 54 fi 51 55 52 56 skip_concurrent=yes
+14
ci/config/README
··· 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").
-27
ci/config/allow-ref.sample
··· 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