Skip to content

Commit

Permalink
Merge branch 'jk/ci-retire-allow-ref' into maint-2.42
Browse files Browse the repository at this point in the history
CI update.

* jk/ci-retire-allow-ref:
  ci: deprecate ci/config/allow-ref script
  ci: allow branch selection through "vars"
  • Loading branch information
gitster committed Nov 2, 2023
2 parents 1a3712f + edf80d2 commit 0510d06
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 30 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ concurrency:
jobs:
ci-config:
name: config
if: vars.CI_BRANCHES == '' || contains(vars.CI_BRANCHES, github.ref_name)
runs-on: ubuntu-latest
outputs:
enabled: ${{ steps.check-ref.outputs.enabled }}${{ steps.skip-if-redundant.outputs.enabled }}
Expand All @@ -43,10 +44,13 @@ jobs:
name: check whether CI is enabled for ref
run: |
enabled=yes
if test -x config-repo/ci/config/allow-ref &&
! config-repo/ci/config/allow-ref '${{ github.ref }}'
if test -x config-repo/ci/config/allow-ref
then
enabled=no
echo "::warning::ci/config/allow-ref is deprecated; use CI_BRANCHES instead"
if ! config-repo/ci/config/allow-ref '${{ github.ref }}'
then
enabled=no
fi
fi
skip_concurrent=yes
Expand Down
14 changes: 14 additions & 0 deletions ci/config/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
You can configure some aspects of the GitHub Actions-based CI on a
per-repository basis by setting "variables" and "secrets" from with the
GitHub web interface. These can be found at:

https://github.com/<user>/git/settings/secrets/actions

The following variables can be used:

- CI_BRANCHES

By default, CI is run when any branch is pushed. If this variable is
non-empty, then only the branches it lists will run CI. Branch names
should be separated by spaces, and should use their shortened form
(e.g., "main", not "refs/heads/main").
27 changes: 0 additions & 27 deletions ci/config/allow-ref.sample

This file was deleted.

0 comments on commit 0510d06

Please sign in to comment.