Skip to content

Commit 40c2149

Browse files
committed
Enhance Claude workflow by adding environment variable for GitHub token and implementing package visibility check and Docker authentication tests for improved reliability and security.
1 parent 7fc9861 commit 40c2149

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

.github/workflows/claude.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
issues: read
2525
id-token: write
2626
packages: read
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2729
steps:
2830
- name: Checkout repository
2931
uses: actions/checkout@v4
@@ -37,9 +39,15 @@ jobs:
3739
echo "GITHUB_REPOSITORY: $GITHUB_REPOSITORY"
3840
echo "GITHUB_REPOSITORY_OWNER: $GITHUB_REPOSITORY_OWNER"
3941
echo "GITHUB_TOKEN exists: $([ -n "$GITHUB_TOKEN" ] && echo "yes" || echo "no")"
40-
echo "=== Docker Info ==="
41-
docker --version
42-
docker info
42+
echo "GITHUB_TOKEN length: ${#GITHUB_TOKEN}"
43+
44+
- name: Check Package Visibility
45+
run: |
46+
echo "=== Checking Package Visibility ==="
47+
curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
48+
-H "Accept: application/vnd.github.v3+json" \
49+
"https://api.github.com/users/MervinPraison/packages/container/praisonai-claudecode" \
50+
|| echo "Package API call failed"
4351
4452
- name: Login to GitHub Container Registry
4553
uses: docker/login-action@v3
@@ -48,6 +56,15 @@ jobs:
4856
username: ${{ github.actor }}
4957
password: ${{ secrets.GITHUB_TOKEN }}
5058

59+
- name: Test Docker Authentication
60+
run: |
61+
echo "=== Testing Docker Authentication ==="
62+
echo "Checking ~/.docker/config.json"
63+
cat ~/.docker/config.json | jq '.' || echo "No docker config found"
64+
echo "=== Testing Registry Access ==="
65+
curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
66+
"https://ghcr.io/v2/" || echo "Registry access failed"
67+
5168
- name: Test Docker Pull
5269
run: |
5370
echo "=== Testing Docker Pull ==="
@@ -56,11 +73,6 @@ jobs:
5673
echo "=== Checking Docker Images ==="
5774
docker images | grep praisonai-claudecode || echo "No images found"
5875
59-
- name: Test Manual Docker Run
60-
run: |
61-
echo "=== Testing Manual Docker Run ==="
62-
docker run --rm ghcr.io/mervinpraison/praisonai-claudecode:latest echo "Container started successfully" || echo "Manual run failed with exit code: $?"
63-
6476
- name: Run Claude Code
6577
id: claude
6678
uses: ./.github/actions/claude-code-action

0 commit comments

Comments
 (0)