From 867cc17ebf140d39cfb66d271fd0250ba4c0ac5f Mon Sep 17 00:00:00 2001 From: Moody6 Date: Mon, 19 Oct 2026 11:44:51 +0000 Subject: [PATCH] Update .gitea/workflows/diagnose.yaml --- .gitea/workflows/diagnose.yaml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/diagnose.yaml b/.gitea/workflows/diagnose.yaml index 994f1cb..32f3d42 100644 --- a/.gitea/workflows/diagnose.yaml +++ b/.gitea/workflows/diagnose.yaml @@ -1,5 +1,5 @@ -name: Diagnose GitHub mirror +name: Diagnose GitHub sync on: push: @@ -11,16 +11,24 @@ jobs: diagnose: runs-on: ubuntu-latest steps: - - name: Check source and credentials + - name: Check GitHub access env: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | set -eu - echo "Triggered ref: $GITHUB_REF" - echo "Source commit: $GITHUB_SHA" - if [ -z "$GH_TOKEN" ]; then - echo "ERROR: GH_TOKEN is empty or unavailable" - exit 1 - fi - echo "GitHub token is present" - git --version + + REPO="tafakkur/PyNix-Website" + AUTH="$(printf 'x-access-token:%s' "$GH_TOKEN" | base64 | tr -d '\n')" + + git_auth() { + git -c http.extraheader="AUTHORIZATION: basic $AUTH" "$@" + } + + echo "Checking GitHub repository access..." + git_auth ls-remote \ + "https://github.com/${REPO}.git" refs/heads/main + + echo "Checking source commit..." + echo "$GITHUB_SHA" + + echo "GitHub read access succeeded."