Skip to content

Commit eea3db0

Browse files
committed
Debugging.
1 parent 9e5c0cb commit eea3db0

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/actions/debug/action.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,48 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Debug GitHub Actions Environment
10+
env:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1013
run: |
1114
echo "### 🔍 Checking GitHub Secrets & Environment Variables ###"
1215
1316
# Check if GITHUB_TOKEN is set
1417
if [[ -z "$GITHUB_TOKEN" ]]; then
15-
echo "❌ GITHUB_TOKEN is NOT set. This may be due to missing permissions or a misconfigured repository secret.";
18+
echo "❌ GITHUB_TOKEN is NOT set. Ensure it is available in repository secrets.";
1619
else
1720
echo "✅ GITHUB_TOKEN is set.";
1821
fi
1922
2023
# Check if NPM_TOKEN is set
2124
if [[ -z "$NPM_TOKEN" ]]; then
22-
echo "❌ NPM_TOKEN is NOT set. Ensure it exists in repository secrets under Settings → Secrets.";
25+
echo "❌ NPM_TOKEN is NOT set. Ensure it exists in repository secrets.";
2326
else
2427
echo "✅ NPM_TOKEN is set.";
2528
fi
26-
echo "### 🔍 Checking GitHub Secrets & Environment Variables ###"
2729
28-
# Check current GitHub Actions permissions
30+
- name: Install jq
31+
run: sudo apt-get update && sudo apt-get install -y jq
32+
33+
- name: Check GitHub Actions Permissions
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
run: |
2937
echo "🔹 Workflow permissions setting:"
3038
curl -s -H "Authorization: token $GITHUB_TOKEN" \
3139
-H "Accept: application/vnd.github.v3+json" \
32-
https://api.github.com/repos/${{ github.repository }} \
40+
"https://api.github.com/repos/${{ github.repository }}" \
3341
| jq '.permissions'
3442
35-
# Check if running from a forked repo (which can block secrets)
43+
- name: Check Fork Status
44+
run: |
3645
if [[ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
3746
echo "⚠️ This workflow is running from a fork. GitHub restricts repository secrets for forks.";
3847
else
3948
echo "✅ This workflow is running in the original repository.";
4049
fi
4150
42-
# Check if environment variables are set
51+
- name: Check System Environment Variables
52+
run: |
4353
echo "🔹 Checking system environment variables:"
4454
env | grep -E 'GITHUB|NPM' || echo "⚠️ No GITHUB/NPM environment variables found."

0 commit comments

Comments
 (0)