Compare commits

..

4 Commits

Author SHA1 Message Date
peaceiris
8a36604631 chore(release): 3.2.0
Some checks failed
Release / release (push) Has been cancelled
2020-02-19 23:36:06 +09:00
peaceiris
a8fa52a354 chore(release): Add build assets 2020-02-19 23:36:05 +09:00
Shohei Ueda
74f652acfd feat: Remove warning about GITHUB_TOKEN (#108)
GitHub might have started to supporting to trigger the GitHub Pages build event by GITHUB_TOKEN on public repositories. (We can already use the token on private repositories.) Be careful, there is no official announcement about this by GitHub.

cf. #9
2020-02-19 23:22:07 +09:00
peaceiris
7b9b3b3f5f chore(release): Remove build assets [skip ci] 2020-02-19 22:58:13 +09:00
5 changed files with 11 additions and 17 deletions

View File

@@ -2,6 +2,15 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
# [3.2.0](https://github.com/peaceiris/actions-gh-pages/compare/v3.1.0...v3.2.0) (2020-02-19)
### feat
* Remove warning about GITHUB_TOKEN (#108) ([74f652a](https://github.com/peaceiris/actions-gh-pages/commit/74f652acfdfc3290f8b6f7c5e65fd1f563412cf5)), closes [#108](https://github.com/peaceiris/actions-gh-pages/issues/108) [#9](https://github.com/peaceiris/actions-gh-pages/issues/9)
# [3.1.0](https://github.com/peaceiris/actions-gh-pages/compare/v3.0.3...v3.1.0) (2020-02-19)

View File

@@ -9571,14 +9571,11 @@ Host github
}
exports.setSSHKey = setSSHKey;
function setGithubToken(inps, publishRepo) {
var _a, _b;
return __awaiter(this, void 0, void 0, function* () {
core.info('[INFO] setup GITHUB_TOKEN');
const context = github.context;
const payload = github.context.payload;
core.debug(`ref: ${context.ref}`);
core.debug(`eventName: ${context.eventName}`);
core.debug(`private: ${(_a = payload.repository) === null || _a === void 0 ? void 0 : _a.private}`);
let isProhibitedBranch = false;
const ref = context.ref;
if (context.eventName === 'push') {
@@ -9587,13 +9584,9 @@ function setGithubToken(inps, publishRepo) {
throw new Error(`You deploy from ${inps.PublishBranch} to ${inps.PublishBranch}`);
}
}
const isPrivateRepository = (_b = payload.repository) === null || _b === void 0 ? void 0 : _b.private;
if (inps.ExternalRepository) {
throw new Error('GITHUB_TOKEN does not support to push to an external repository');
}
if (isPrivateRepository === false) {
core.warning('GITHUB_TOKEN does not support to trigger the GitHub Pages build event on a public repository');
}
return `https://x-access-token:${inps.GithubToken}@github.com/${publishRepo}.git`;
});
}

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "actions-github-pages",
"version": "3.1.0",
"version": "3.2.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "actions-github-pages",
"version": "3.1.0",
"version": "3.2.0",
"description": "GitHub Actions for GitHub Pages",
"main": "lib/index.js",
"engines": {

View File

@@ -73,10 +73,8 @@ export async function setGithubToken(
core.info('[INFO] setup GITHUB_TOKEN');
const context = github.context;
const payload = github.context.payload;
core.debug(`ref: ${context.ref}`);
core.debug(`eventName: ${context.eventName}`);
core.debug(`private: ${payload.repository?.private}`);
let isProhibitedBranch = false;
const ref = context.ref;
@@ -89,17 +87,11 @@ export async function setGithubToken(
}
}
const isPrivateRepository = payload.repository?.private;
if (inps.ExternalRepository) {
throw new Error(
'GITHUB_TOKEN does not support to push to an external repository'
);
}
if (isPrivateRepository === false) {
core.warning(
'GITHUB_TOKEN does not support to trigger the GitHub Pages build event on a public repository'
);
}
return `https://x-access-token:${inps.GithubToken}@github.com/${publishRepo}.git`;
}