mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Pusher is undefined in scheduled jobs (#62)
* Fallback for name and email * Build
This commit is contained in:
parent
1c579cbd85
commit
c4cfbc80af
@ -24,8 +24,16 @@ exports.action = {
|
||||
accessToken: core.getInput("ACCESS_TOKEN"),
|
||||
branch: core.getInput("BRANCH"),
|
||||
baseBranch: core.getInput("BASE_BRANCH") || "master",
|
||||
clean: core.getInput("CLEAN"),
|
||||
pusher
|
||||
name: pusher && pusher.name
|
||||
? pusher.name
|
||||
: process.env.GITHUB_ACTOR
|
||||
? process.env.GITHUB_ACTOR
|
||||
: "GitHub Pages Deploy Action",
|
||||
email: pusher && pusher.email
|
||||
? pusher.email
|
||||
: `${process.env.GITHUB_ACTOR ||
|
||||
"github-pages-deploy-action"}@users.noreply.github.com`,
|
||||
clean: core.getInput("CLEAN")
|
||||
};
|
||||
// Repository path used for commits/pushes.
|
||||
exports.repositoryPath = `https://${exports.action.accessToken ||
|
||||
|
@ -32,8 +32,8 @@ function init() {
|
||||
return core.setFailed(`The deployment folder cannot be prefixed with '/' or './'. Instead reference the folder name directly.`);
|
||||
}
|
||||
yield util_1.execute(`git init`, constants_1.workspace);
|
||||
yield util_1.execute(`git config user.name ${constants_1.action.pusher.name}`, constants_1.workspace);
|
||||
yield util_1.execute(`git config user.email ${constants_1.action.pusher.email}`, constants_1.workspace);
|
||||
yield util_1.execute(`git config user.name ${constants_1.action.name}`, constants_1.workspace);
|
||||
yield util_1.execute(`git config user.email ${constants_1.action.email}`, constants_1.workspace);
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(`There was an error initializing the repository: ${error}`);
|
||||
|
@ -19,8 +19,18 @@ export const action = {
|
||||
accessToken: core.getInput("ACCESS_TOKEN"),
|
||||
branch: core.getInput("BRANCH"),
|
||||
baseBranch: core.getInput("BASE_BRANCH") || "master",
|
||||
clean: core.getInput("CLEAN"),
|
||||
pusher
|
||||
name:
|
||||
pusher && pusher.name
|
||||
? pusher.name
|
||||
: process.env.GITHUB_ACTOR
|
||||
? process.env.GITHUB_ACTOR
|
||||
: "GitHub Pages Deploy Action",
|
||||
email:
|
||||
pusher && pusher.email
|
||||
? pusher.email
|
||||
: `${process.env.GITHUB_ACTOR ||
|
||||
"github-pages-deploy-action"}@users.noreply.github.com`,
|
||||
clean: core.getInput("CLEAN")
|
||||
};
|
||||
|
||||
// Repository path used for commits/pushes.
|
||||
|
@ -20,8 +20,8 @@ export async function init(): Promise<any> {
|
||||
}
|
||||
|
||||
await execute(`git init`, workspace);
|
||||
await execute(`git config user.name ${action.pusher.name}`, workspace);
|
||||
await execute(`git config user.email ${action.pusher.email}`, workspace);
|
||||
await execute(`git config user.name ${action.name}`, workspace);
|
||||
await execute(`git config user.email ${action.email}`, workspace);
|
||||
} catch (error) {
|
||||
core.setFailed(`There was an error initializing the repository: ${error}`);
|
||||
} finally {
|
||||
|
Loading…
Reference in New Issue
Block a user