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:
|
||||
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."
|
||||
Reference in new issue
Block a user