Skip to content

Commit 40d8c82

Browse files
committed
Update tox-lint action for gitea compatibility
1 parent 760af9f commit 40d8c82

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/tox-lint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,24 @@ jobs:
4242
sudo apt-get update -q
4343
sudo apt-get install -qy libcap-dev
4444
45+
# GitHub mounts Node into containers, so actions/checkout works everywhere.
46+
# Gitea runners don't, so the buster container needs a manual git clone.
4547
- name: Checkout repository
48+
if: "!(matrix.python-version == '2.7' && env.GITEA_ACTIONS == 'true')"
4649
uses: actions/checkout@v4
4750

51+
- name: Checkout repository (Gitea container)
52+
if: matrix.python-version == '2.7' && env.GITEA_ACTIONS == 'true'
53+
env:
54+
TOKEN: ${{ github.token }}
55+
run: |
56+
git config --global --add safe.directory "$PWD"
57+
git init
58+
SERVER="${GITHUB_SERVER_URL#https://}"
59+
git remote add origin "https://x-access-token:${TOKEN}@${SERVER}/${GITHUB_REPOSITORY}.git"
60+
git fetch --depth 1 origin "${GITHUB_SHA}"
61+
git checkout FETCH_HEAD
62+
4863
# ── Python 3 ───────────────────────────────────────────────
4964
- name: Set up Python ${{ matrix.python-version }}
5065
if: matrix.python-version != '2.7'

0 commit comments

Comments
 (0)