26 lines
No EOL
1 KiB
YAML
26 lines
No EOL
1 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
clone-current:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone current repo using Git extraheader
|
|
run: |
|
|
# Generate base64 basic auth string (GitHub automatically masks the token in logs)
|
|
AUTH=$(echo -n "x-access-token:${{ secrets.GITHUB_TOKEN }}" | base64 -w 0)
|
|
|
|
# Tell git to use this header for all requests to this specific GitHub server
|
|
git config --global http.${{ github.server_url }}/.extraheader "AUTHORIZATION: basic $AUTH"
|
|
|
|
# Now you can clone cleanly using the dynamically provided clone_url
|
|
# Using github.event.repository.clone_url (if triggered by a webhook)
|
|
# OR fallback to github.server_url/github.repository
|
|
CLONE_URL="${{ github.event.repository.clone_url }}"
|
|
|
|
git clone "$CLONE_URL" repo.git --bare
|
|
echo "cloned"
|
|
git -C repo.git diff --name-status a72eda19f1e8e90fb2a38de0e80c8415a6079a36...main -- src/ |