Skip to content

Commit b263205

Browse files
authored
Release v2.2.0 (#19)
* try to fix: remote repo URL for GITHUB_TOKEN cf. https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#http-based-git-access-by-an-installation * add: PERSONAL_TOKEN * update: readme about PERSONAL_TOKEN
1 parent 8fd3a55 commit b263205

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ By pulling docker images, you can reduce the overall execution time of your work
9191

9292
- [peaceiris/gha-hugo - Docker Hub](https://hub.docker.com/r/peaceiris/gha-hugo)
9393

94+
#### `PERSONAL_TOKEN`
95+
96+
[Create a personal access token (`repo`)](https://github.com/settings/tokens) and add it to Secrets as `PERSONAL_TOKEN`, it works as well as `ACTIONS_DEPLOY_KEY`.
97+
98+
```diff
99+
- ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
100+
+ PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
101+
```
102+
94103
#### `GITHUB_TOKEN`
95104

96105
> **NOTES**: This action supports `GITHUB_TOKEN` but it has some problems to deploy to GitHub Pages. See #9

entrypoint.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,20 @@ if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then
2323

2424
remote_repo="[email protected]:${GITHUB_REPOSITORY}.git"
2525

26+
elif [ -n "${PERSONAL_TOKEN}" ]; then
27+
28+
print_info "setup with PERSONAL_TOKEN"
29+
30+
remote_repo="https://x-access-token:${PERSONAL_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
31+
2632
elif [ -n "${GITHUB_TOKEN}" ]; then
2733

2834
print_info "setup with GITHUB_TOKEN"
2935

30-
remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
36+
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
3137

3238
else
33-
print_error "not found ACTIONS_DEPLOY_KEY or GITHUB_TOKEN"
39+
print_error "not found ACTIONS_DEPLOY_KEY, PERSONAL_TOKEN, or GITHUB_TOKEN"
3440
exit 1
3541
fi
3642

0 commit comments

Comments
 (0)