fix(ci): use env var for secret
Some checks failed
CI/CD / Test (push) Successful in 30s
CI/CD / Lint (push) Successful in 40s
CI/CD / Generate SBOM (push) Successful in 16s
CI/CD / Build (darwin-amd64) (push) Successful in 22s
CI/CD / Build (linux-amd64) (push) Successful in 22s
CI/CD / Build (darwin-arm64) (push) Successful in 22s
CI/CD / Build (linux-arm64) (push) Successful in 22s
CI/CD / Build & Push Docker Image (push) Successful in 22s
CI/CD / Mirror to GitHub (push) Failing after 29s
CI/CD / Release (push) Has been skipped

This commit is contained in:
2025-12-13 16:11:26 +01:00
parent 3c5893e5a8
commit be1f64a256

View File

@@ -206,20 +206,16 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Push to GitHub - name: Push to GitHub
env:
GITHUB_TOKEN: ${{ secrets.GITHUBMIRRORTOKEN }}
run: | run: |
echo "Checking if token is set..." echo "Starting mirror..."
if [ -z "${{ secrets.GITHUBMIRRORTOKEN }}" ]; then if [ -z "${GITHUB_TOKEN}" ]; then
echo "ERROR: GITHUBMIRRORTOKEN secret is empty!" echo "ERROR: GITHUBMIRRORTOKEN secret is empty!"
exit 1 exit 1
fi fi
echo "Token is set, length: ${#GITHUB_TOKEN}" echo "Token length: ${#GITHUB_TOKEN}"
git remote -v git remote add github "https://x-access-token:${GITHUB_TOKEN}@github.com/PlusOne/hmac-file-server.git"
git remote add github https://x-access-token:${{ secrets.GITHUBMIRRORTOKEN }}@github.com/PlusOne/hmac-file-server.git
git remote -v
echo "Pushing branches..."
git push --force --all github git push --force --all github
echo "Pushing tags..."
git push --force --tags github git push --force --tags github
echo "Mirror complete!" echo "Mirror complete!"
env:
GITHUB_TOKEN: ${{ secrets.GITHUBMIRRORTOKEN }}