1515 image : ${{ matrix.container-image }}
1616 env :
1717 PYTHON : ${{ matrix.python-version }}
18- runs-on : [ ubuntu-20.04]
18+ runs-on : ubuntu-latest
1919 strategy :
2020 # Finish the other builds even if one fails.
2121 fail-fast : false
@@ -24,13 +24,39 @@ jobs:
2424 include :
2525 - python-version : ' 2.7'
2626 container-image : python:2.7
27+ - python-version : ' 3.7'
28+ container-image : python:3.7
2729 steps :
2830 - uses : actions/checkout@v4
2931 with :
3032 # Fetch all the history so setuptools_scm can version relative to the
3133 # most recent version tag.
3234 fetch-depth : 0
3335
36+ - name : Let git run in the containerized workspace
37+ if : matrix.container-image
38+ run : |
39+ set -euxo pipefail
40+
41+ # Actions will create the workspace directory as runner (uid 1001) on
42+ # the "real" agent host before it runs the container. actions/checkout
43+ # will set `safe.directory` so it can check out the project as the
44+ # container user to runner's workspace directory, but it does so with
45+ # a temporary $HOME set, so `safe.directory` appears unset by the time
46+ # we're in another step. For containers with git 2.30.2+, like
47+ # python:3.7, that means git operations will exit with a "dubious
48+ # ownership" error.
49+ id -u
50+ ls -lAd "$GITHUB_WORKSPACE"
51+ ls -lA "$GITHUB_WORKSPACE"
52+ git config --get-all safe.directory || true
53+
54+ # Set safe.directory on the workspace so that setuptools-scm can
55+ # identify the version of the package we're packaging.
56+ git config --global --add safe.directory "$GITHUB_WORKSPACE"
57+
58+ shell : bash
59+
3460 - uses : actions/setup-python@v5
3561 # Only set up Python if we're running directly on an agent. If we're in
3662 # a container, the image should already provide the intended Python.
0 commit comments