Skip to content

Commit

Permalink
[github-actions] removed hakuneko personal access token
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronny Wegener committed Jan 18, 2020
1 parent ac8b489 commit fbef1dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
- name: Deploy (web)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HAKUNEKO_TOKEN: ${{ secrets.HAKUNEKO_ACCESS_TOKEN }}
HAKUNEKO_PASSPHRASE: ${{ secrets.HAKUNEKO_PASSPHRASE }}
# set variable with branch that triggered the action (e.g. GITHUB_BRANCH = ${{ github.ref }})
run: npm run deploy:web
5 changes: 2 additions & 3 deletions deploy-web.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ async function sslPack(archive, meta) {
async function gitCommit() {
let user = process.env.GITHUB_ACTOR;
let mail = user + '@users.noreply.github.com';
let token = process.env.HAKUNEKO_TOKEN || process.env.GITHUB_TOKEN;
let auth = Buffer.from('x-access-token:' + token).toString('base64');
let auth = Buffer.from('x-access-token:' + process.env.GITHUB_TOKEN).toString('base64');
await execute(`git add ${config.directory}/*`);
await execute(`git -c user.name="${user}" -c user.email="${mail}" commit -m 'Deployed Release: ${config.directory}'`);
await execute(`git -c http.extraheader="AUTHORIZATION: Basic ${auth}" push origin HEAD:${config.branch}`);
Expand All @@ -73,7 +72,7 @@ async function gitCommit() {
// - https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869
// - https://github.com/peaceiris/actions-gh-pages/issues/9
let uri = `https://api.github.com/repos/manga-download/hakuneko/pages/builds`;
await execute(`curl -L -X POST -H "Content-Type: application/json" -H "Authorization: TOKEN ${process.env.HAKUNEKO_TOKEN}" ${uri}`)
await execute(`curl -L -X POST -H "Content-Type: application/json" -H "Authorization: TOKEN ${process.env.GITHUB_TOKEN}" ${uri}`)
}

async function main() {
Expand Down

0 comments on commit fbef1dc

Please sign in to comment.