Update .gitea/workflows/diagnose.yaml
This commit is contained in:
1 parent
0d26916458
commit
867cc17ebf
1 file changed
+18
-10
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
name: Diagnose GitHub mirror
|
name: Diagnose GitHub sync
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -11,16 +11,24 @@ jobs:
|
|||||||
diagnose:
|
diagnose:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check source and credentials
|
- name: Check GitHub access
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
echo "Triggered ref: $GITHUB_REF"
|
|
||||||
echo "Source commit: $GITHUB_SHA"
|
REPO="tafakkur/PyNix-Website"
|
||||||
if [ -z "$GH_TOKEN" ]; then
|
AUTH="$(printf 'x-access-token:%s' "$GH_TOKEN" | base64 | tr -d '\n')"
|
||||||
echo "ERROR: GH_TOKEN is empty or unavailable"
|
|
||||||
exit 1
|
git_auth() {
|
||||||
fi
|
git -c http.extraheader="AUTHORIZATION: basic $AUTH" "$@"
|
||||||
echo "GitHub token is present"
|
}
|
||||||
git --version
|
|
||||||
|
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."
|
||||||
Reference in new issue
Block a user