Datasets:
(fix): verify the actor token before building
Browse files
.github/workflows/build-dataset.yml
CHANGED
|
@@ -33,6 +33,8 @@ jobs:
|
|
| 33 |
build:
|
| 34 |
runs-on: ubuntu-latest
|
| 35 |
timeout-minutes: 60
|
|
|
|
|
|
|
| 36 |
steps:
|
| 37 |
- uses: actions/checkout@v4
|
| 38 |
with:
|
|
@@ -40,6 +42,18 @@ jobs:
|
|
| 40 |
token: ${{ secrets.ACTOR_TOKEN || github.token }}
|
| 41 |
fetch-depth: 0
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
- uses: actions/checkout@v4
|
| 44 |
with:
|
| 45 |
repository: lostflux/functional-scraper
|
|
|
|
| 33 |
build:
|
| 34 |
runs-on: ubuntu-latest
|
| 35 |
timeout-minutes: 60
|
| 36 |
+
env:
|
| 37 |
+
HAS_ACTOR_TOKEN: ${{ secrets.ACTOR_TOKEN != '' }}
|
| 38 |
steps:
|
| 39 |
- uses: actions/checkout@v4
|
| 40 |
with:
|
|
|
|
| 42 |
token: ${{ secrets.ACTOR_TOKEN || github.token }}
|
| 43 |
fetch-depth: 0
|
| 44 |
|
| 45 |
+
- name: check actor token
|
| 46 |
+
if: env.HAS_ACTOR_TOKEN == 'true'
|
| 47 |
+
env:
|
| 48 |
+
GH_TOKEN: ${{ secrets.ACTOR_TOKEN }}
|
| 49 |
+
run: |
|
| 50 |
+
echo "token belongs to: $(gh api user --jq .login 2>/dev/null || echo '<not a valid user token>')"
|
| 51 |
+
for r in lostflux/functional-scraper lostflux/ai-tech-articles; do
|
| 52 |
+
echo "$r: $(gh api repos/$r --jq '.permissions' 2>/dev/null || echo 'no access (404/403)')"
|
| 53 |
+
done
|
| 54 |
+
gh api repos/${{ github.repository }} --jq '.permissions.push' 2>/dev/null | grep -q true \
|
| 55 |
+
|| { echo "::error::ACTOR_TOKEN cannot push to ${{ github.repository }}: for an org repo the fine-grained PAT needs resource owner 'lostflux', this repo in its repository list, Contents read+write, and org approval if required"; exit 1; }
|
| 56 |
+
|
| 57 |
- uses: actions/checkout@v4
|
| 58 |
with:
|
| 59 |
repository: lostflux/functional-scraper
|