Skip to content

Commit 5f2ad6a

Browse files
committed
test: add ARTIFACT_REPO_TOKEN verification workflow
1 parent 4353488 commit 5f2ad6a

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: "[TEST] Verify ARTIFACT_REPO_TOKEN"
2+
3+
on:
4+
workflow_dispatch: {}
5+
6+
jobs:
7+
verify-token:
8+
name: Verify ARTIFACT_REPO_TOKEN read/write access
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check secret presence
13+
env:
14+
ARTIFACT_REPO_TOKEN: ${{ secrets.ARTIFACT_REPO_TOKEN }}
15+
run: |
16+
if [[ -z "${ARTIFACT_REPO_TOKEN:-}" ]]; then
17+
echo "::error::ARTIFACT_REPO_TOKEN is not configured in repository secrets."
18+
echo "Go to: Settings → Secrets and variables → Actions → New repository secret"
19+
exit 1
20+
fi
21+
echo "✅ ARTIFACT_REPO_TOKEN is present (length: ${#ARTIFACT_REPO_TOKEN})"
22+
23+
- name: Test clone (read access)
24+
env:
25+
ARTIFACT_REPO_TOKEN: ${{ secrets.ARTIFACT_REPO_TOKEN }}
26+
run: |
27+
echo "🔍 Testing read access by cloning wysaid/android-gpuimage-plus-maven ..."
28+
git clone --depth 1 "https://${ARTIFACT_REPO_TOKEN}@github.com/wysaid/android-gpuimage-plus-maven.git" /tmp/maven-test
29+
echo "✅ Clone succeeded"
30+
ls /tmp/maven-test
31+
32+
- name: Test push to temp branch (write access) and clean up
33+
env:
34+
ARTIFACT_REPO_TOKEN: ${{ secrets.ARTIFACT_REPO_TOKEN }}
35+
run: |
36+
cd /tmp/maven-test
37+
git config user.name "github-actions[bot]"
38+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+
40+
TEST_BRANCH="ci-token-test/$(date +%Y%m%d-%H%M%S)"
41+
echo "📝 Creating test branch: $TEST_BRANCH"
42+
git checkout -b "$TEST_BRANCH"
43+
44+
echo "token-write-test $(date -u)" > .token-test
45+
git add .token-test
46+
git commit -m "chore: token write test (will be deleted)"
47+
48+
echo "⬆️ Pushing test branch..."
49+
git push origin "$TEST_BRANCH"
50+
echo "✅ Push succeeded"
51+
52+
echo "🧹 Deleting test branch from remote..."
53+
git push origin --delete "$TEST_BRANCH"
54+
echo "✅ Test branch cleaned up"
55+
56+
- name: Summary
57+
run: |
58+
echo "## ✅ ARTIFACT_REPO_TOKEN is correctly configured" >> $GITHUB_STEP_SUMMARY
59+
echo "" >> $GITHUB_STEP_SUMMARY
60+
echo "| Check | Result |" >> $GITHUB_STEP_SUMMARY
61+
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
62+
echo "| Secret present | ✅ |" >> $GITHUB_STEP_SUMMARY
63+
echo "| Clone (read access) | ✅ |" >> $GITHUB_STEP_SUMMARY
64+
echo "| Push & delete branch (write access) | ✅ |" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)