Compare commits
73 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
373f7f263a | ||
|
|
00e2f338db | ||
|
|
31c15f0329 | ||
|
|
6f6875cdf6 | ||
|
|
ee58d74b7a | ||
|
|
67383c90a3 | ||
|
|
f2f45dd826 | ||
|
|
69c02d4e82 | ||
|
|
b8ecadfc08 | ||
|
|
66f12e737e | ||
|
|
5a7e52de3d | ||
|
|
599324c6ed | ||
|
|
0d67ec5c39 | ||
|
|
78b3816969 | ||
|
|
43f2073e60 | ||
|
|
486938a015 | ||
|
|
883423edd8 | ||
|
|
92c7c21410 | ||
|
|
65d77f816a | ||
|
|
2c0c03e6f4 | ||
|
|
28958bab3a | ||
|
|
aca9d72df7 | ||
|
|
c68a9bf36e | ||
|
|
773d4316b8 | ||
|
|
33d882af54 | ||
|
|
93bd8c5f6d | ||
|
|
1008c8c81c | ||
|
|
e9cc68c240 | ||
|
|
884a0224fd | ||
|
|
e5d60a65a4 | ||
|
|
06aa22c0f9 | ||
|
|
cc91d0e9f8 | ||
|
|
45065d5c03 | ||
|
|
2c16db0f50 | ||
|
|
589f1617f5 | ||
|
|
32e33dcd3a | ||
|
|
1977c44664 | ||
|
|
bd8c6b06eb | ||
|
|
ae7759a398 | ||
|
|
9b7ce2a171 | ||
|
|
983978086a | ||
|
|
7859c9b784 | ||
|
|
fd54e565f4 | ||
|
|
2c6daf7153 | ||
|
|
8206a5f364 | ||
|
|
cba22ba760 | ||
|
|
87c1b90704 | ||
|
|
411de78882 | ||
|
|
9209134025 | ||
|
|
2ae4e44c71 | ||
|
|
20411ac459 | ||
|
|
76446f8a5e | ||
|
|
8fc4f66b0e | ||
|
|
6932db2544 | ||
|
|
16b8f766df | ||
|
|
ffa3183092 | ||
|
|
afad39bf81 | ||
|
|
29aefb7700 | ||
|
|
0725e5789b | ||
|
|
3b42e19751 | ||
|
|
fe2eb19a96 | ||
|
|
25b90d1c7e | ||
|
|
416f539fb4 | ||
|
|
32c9288f55 | ||
|
|
da1b4ad62b | ||
|
|
b992418825 | ||
|
|
6c8719badb | ||
|
|
47d01f16d3 | ||
|
|
5e5dc6d02e | ||
|
|
7af79a873e | ||
|
|
dd7d778958 | ||
|
|
e3aa46d23b | ||
|
|
2306f39f4e |
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -8,7 +8,7 @@ contact_links:
|
|||||||
about: Please ask questions about GitHub Actions here.
|
about: Please ask questions about GitHub Actions here.
|
||||||
- name: GitHub Pages Documentation
|
- name: GitHub Pages Documentation
|
||||||
url: https://docs.github.com/en/pages
|
url: https://docs.github.com/en/pages
|
||||||
about: GitHub Pages official documentaion here.
|
about: GitHub Pages official documentation here.
|
||||||
- name: GitHub Actions Documentation
|
- name: GitHub Actions Documentation
|
||||||
url: https://docs.github.com/en/actions
|
url: https://docs.github.com/en/actions
|
||||||
about: GitHub Actions official documentation here.
|
about: GitHub Actions official documentation here.
|
||||||
|
|||||||
23
.github/dependabot.yml
vendored
23
.github/dependabot.yml
vendored
@@ -1,23 +0,0 @@
|
|||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: npm
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: daily
|
|
||||||
time: '11:00'
|
|
||||||
timezone: Japan
|
|
||||||
labels:
|
|
||||||
- dependencies
|
|
||||||
allow:
|
|
||||||
- dependency-type: "production"
|
|
||||||
commit-message:
|
|
||||||
prefix: deps
|
|
||||||
|
|
||||||
- package-ecosystem: "github-actions"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "daily"
|
|
||||||
labels:
|
|
||||||
- "cicd"
|
|
||||||
commit-message:
|
|
||||||
prefix: ci
|
|
||||||
2
.github/labeler.yml
vendored
2
.github/labeler.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
CI/CD:
|
cicd:
|
||||||
- .github/workflows/*
|
- .github/workflows/*
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|||||||
2
.github/workflows/labeler.yml
vendored
2
.github/workflows/labeler.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
permissions: {}
|
permissions: {}
|
||||||
steps:
|
steps:
|
||||||
# https://github.com/peaceiris/actions-github-app-token
|
# https://github.com/peaceiris/actions-github-app-token
|
||||||
- uses: peaceiris/actions-github-app-token@v1.1.5
|
- uses: peaceiris/actions-github-app-token@v1.1.6
|
||||||
id: app
|
id: app
|
||||||
with:
|
with:
|
||||||
app_id: ${{ secrets.GH_APP_ID }}
|
app_id: ${{ secrets.GH_APP_ID }}
|
||||||
|
|||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -11,6 +11,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
# https://github.com/peaceiris/workflows/blob/main/create-release-npm/action.yml
|
# https://github.com/peaceiris/workflows/blob/main/create-release-npm/action.yml
|
||||||
- uses: peaceiris/workflows/create-release-npm@v0.18.1
|
- uses: peaceiris/workflows/create-release-npm@v0.19.1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@@ -29,19 +29,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Dump GitHub context
|
- uses: peaceiris/workflows/setup-node@v0.19.1
|
||||||
env:
|
|
||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
||||||
run: echo "${GITHUB_CONTEXT}"
|
|
||||||
|
|
||||||
- name: Read .nvmrc
|
|
||||||
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
|
|
||||||
id: nvm
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
with:
|
||||||
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
node-version-file: ".nvmrc"
|
||||||
|
|
||||||
- name: Dump version
|
- name: Dump version
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
npm ci
|
npm install
|
||||||
git remote prune origin
|
git remote prune origin
|
||||||
|
|||||||
36
CHANGELOG.md
36
CHANGELOG.md
@@ -2,6 +2,42 @@
|
|||||||
|
|
||||||
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.
|
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.9.3](https://github.com/peaceiris/actions-gh-pages/compare/v3.9.2...v3.9.3) (2023-03-30)
|
||||||
|
|
||||||
|
|
||||||
|
### docs
|
||||||
|
|
||||||
|
* fix typo, bump hugo version (#851) ([884a022](https://github.com/peaceiris/actions-gh-pages/commit/884a0224fd48faeb3bde89519e9d612d0585a679)), closes [#851](https://github.com/peaceiris/actions-gh-pages/issues/851)
|
||||||
|
|
||||||
|
### fix
|
||||||
|
|
||||||
|
* fix error handling (#841) ([32e33dc](https://github.com/peaceiris/actions-gh-pages/commit/32e33dcd3ae1d0cf56ac5a88267de6cbf0359353)), closes [#841](https://github.com/peaceiris/actions-gh-pages/issues/841)
|
||||||
|
* update known_hosts (#871) ([31c15f0](https://github.com/peaceiris/actions-gh-pages/commit/31c15f03292ac100ae41a50fd3055e00d1b11a32)), closes [#871](https://github.com/peaceiris/actions-gh-pages/issues/871)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [3.9.2](https://github.com/peaceiris/actions-gh-pages/compare/v3.9.1...v3.9.2) (2023-01-17)
|
||||||
|
|
||||||
|
|
||||||
|
### chore
|
||||||
|
|
||||||
|
* rename cicd ([32c9288](https://github.com/peaceiris/actions-gh-pages/commit/32c9288f553bbcbf66869cf553c82754431faf03))
|
||||||
|
* replace npm ci with install ([9839780](https://github.com/peaceiris/actions-gh-pages/commit/983978086a87d25a1ff678aa1ef4c2acc413784a))
|
||||||
|
|
||||||
|
### ci
|
||||||
|
|
||||||
|
* add github-actions npm ([5e5dc6d](https://github.com/peaceiris/actions-gh-pages/commit/5e5dc6d02eeb18001e0a7af6d6fcbabd4fd9e2b7))
|
||||||
|
* enable automerge ([dd7d778](https://github.com/peaceiris/actions-gh-pages/commit/dd7d77895818fd15ebecf20b6bf76028d377e1b6))
|
||||||
|
* remove dependabot ([7af79a8](https://github.com/peaceiris/actions-gh-pages/commit/7af79a873e9c2b6c37690db94012342fdb90914a))
|
||||||
|
* remove enabledManagers ([cba22ba](https://github.com/peaceiris/actions-gh-pages/commit/cba22ba760f1c7e62c9ae43167ea68ca9de56506))
|
||||||
|
* use peaceiris/workflows/setup-node 0.19.1 (#818) ([416f539](https://github.com/peaceiris/actions-gh-pages/commit/416f539fb4263ec46f9bbee251e87cfeae9f85ff)), closes [#818](https://github.com/peaceiris/actions-gh-pages/issues/818)
|
||||||
|
|
||||||
|
### deps
|
||||||
|
|
||||||
|
* apply npm audit fix (#809) ([e3aa46d](https://github.com/peaceiris/actions-gh-pages/commit/e3aa46d23bbf7f669a6d92c15dda089b2edf4959)), closes [#809](https://github.com/peaceiris/actions-gh-pages/issues/809)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [3.9.1](https://github.com/peaceiris/actions-gh-pages/compare/v3.9.0...v3.9.1) (2023-01-05)
|
## [3.9.1](https://github.com/peaceiris/actions-gh-pages/compare/v3.9.0...v3.9.1) (2023-01-05)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ jobs:
|
|||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v2
|
||||||
with:
|
with:
|
||||||
hugo-version: '0.101.0'
|
hugo-version: '0.110.0'
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: hugo --minify
|
run: hugo --minify
|
||||||
|
|||||||
@@ -184,6 +184,6 @@ describe('getInputs()', () => {
|
|||||||
|
|
||||||
expect(() => {
|
expect(() => {
|
||||||
getInputs();
|
getInputs();
|
||||||
}).toThrowError('Use either of enable_jekyll or disable_nojekyll');
|
}).toThrow('Use either of enable_jekyll or disable_nojekyll');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ describe('setRepo()', () => {
|
|||||||
const date = new Date();
|
const date = new Date();
|
||||||
const unixTime = date.getTime();
|
const unixTime = date.getTime();
|
||||||
const workDir = await getWorkDirName(`${unixTime}`);
|
const workDir = await getWorkDirName(`${unixTime}`);
|
||||||
await expect(setRepo(inps, remoteURL, workDir)).rejects.toThrowError(
|
await expect(setRepo(inps, remoteURL, workDir)).rejects.toThrow(
|
||||||
'destination_dir should be a relative path'
|
'destination_dir should be a relative path'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -241,17 +241,13 @@ describe('setCommitAuthor()', () => {
|
|||||||
test('throw error user_email is undefined', async () => {
|
test('throw error user_email is undefined', async () => {
|
||||||
const userName = 'custom-octocat';
|
const userName = 'custom-octocat';
|
||||||
const userEmail = '';
|
const userEmail = '';
|
||||||
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrowError(
|
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrow('user_email is undefined');
|
||||||
'user_email is undefined'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('throw error user_name is undefined', async () => {
|
test('throw error user_name is undefined', async () => {
|
||||||
const userName = '';
|
const userName = '';
|
||||||
const userEmail = 'custom-octocat@github.com';
|
const userEmail = 'custom-octocat@github.com';
|
||||||
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrowError(
|
await expect(setCommitAuthor(userName, userEmail)).rejects.toThrow('user_name is undefined');
|
||||||
'user_name is undefined'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -70,13 +70,13 @@ describe('setGithubToken()', () => {
|
|||||||
'refs/heads/gh-pages-base',
|
'refs/heads/gh-pages-base',
|
||||||
'push'
|
'push'
|
||||||
);
|
);
|
||||||
}).toThrowError('You deploy from gh-pages-base to gh-pages-base');
|
}).toThrow('You deploy from gh-pages-base to gh-pages-base');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('throw error master to master', () => {
|
test('throw error master to master', () => {
|
||||||
expect(() => {
|
expect(() => {
|
||||||
setGithubToken('GITHUB_TOKEN', 'owner/repo', 'master', '', 'refs/heads/master', 'push');
|
setGithubToken('GITHUB_TOKEN', 'owner/repo', 'master', '', 'refs/heads/master', 'push');
|
||||||
}).toThrowError('You deploy from master to master');
|
}).toThrow('You deploy from master to master');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('throw error external repository with GITHUB_TOKEN', () => {
|
test('throw error external repository with GITHUB_TOKEN', () => {
|
||||||
@@ -89,7 +89,7 @@ describe('setGithubToken()', () => {
|
|||||||
'refs/heads/master',
|
'refs/heads/master',
|
||||||
'push'
|
'push'
|
||||||
);
|
);
|
||||||
}).toThrowError(`\
|
}).toThrow(`\
|
||||||
The generated GITHUB_TOKEN (github_token) does not support to push to an external repository.
|
The generated GITHUB_TOKEN (github_token) does not support to push to an external repository.
|
||||||
Use deploy_key or personal_token.
|
Use deploy_key or personal_token.
|
||||||
`);
|
`);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
10957
package-lock.json
generated
10957
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
46
package.json
46
package.json
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "actions-github-pages",
|
"name": "actions-github-pages",
|
||||||
"version": "3.9.1",
|
"version": "3.9.3",
|
||||||
"description": "GitHub Actions for GitHub Pages",
|
"description": "GitHub Actions for GitHub Pages",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.18.0",
|
"node": ">=v16.19.0",
|
||||||
"npm": ">=8.19.0"
|
"npm": ">=9.3.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "npx husky install",
|
"postinstall": "npx husky install",
|
||||||
@@ -49,31 +49,31 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/github": "^5.0.1",
|
"@actions/github": "^5.1.1",
|
||||||
"@actions/glob": "^0.3.0",
|
"@actions/glob": "^0.4.0",
|
||||||
"@actions/io": "^1.1.2",
|
"@actions/io": "^1.1.2",
|
||||||
"@types/shelljs": "^0.8.11",
|
"@types/shelljs": "^0.8.11",
|
||||||
"shelljs": "^0.8.5"
|
"shelljs": "^0.8.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^26.0.20",
|
"@types/jest": "^29.2.6",
|
||||||
"@types/js-yaml": "^4.0.0",
|
"@types/js-yaml": "^4.0.5",
|
||||||
"@types/node": "~12",
|
"@types/node": "~16",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.16.1",
|
"@typescript-eslint/eslint-plugin": "^5.48.2",
|
||||||
"@typescript-eslint/parser": "^4.16.1",
|
"@typescript-eslint/parser": "^5.48.2",
|
||||||
"@vercel/ncc": "^0.27.0",
|
"@vercel/ncc": "^0.36.0",
|
||||||
"eslint": "^7.21.0",
|
"eslint": "^8.32.0",
|
||||||
"eslint-config-prettier": "^8.1.0",
|
"eslint-config-prettier": "^8.6.0",
|
||||||
"eslint-plugin-jest": "^24.1.5",
|
"eslint-plugin-jest": "^27.2.1",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
"husky": "^5.1.3",
|
"husky": "^8.0.3",
|
||||||
"jest": "^26.6.3",
|
"jest": "^29.3.1",
|
||||||
"jest-circus": "^26.6.3",
|
"jest-circus": "^29.3.1",
|
||||||
"js-yaml": "^4.0.0",
|
"js-yaml": "^4.1.0",
|
||||||
"lint-staged": "^10.5.4",
|
"lint-staged": "^13.1.0",
|
||||||
"prettier": "2.2.1",
|
"prettier": "2.8.7",
|
||||||
"standard-version": "^9.1.1",
|
"standard-version": "^9.1.1",
|
||||||
"ts-jest": "^26.5.3",
|
"ts-jest": "^29.0.5",
|
||||||
"typescript": "^4.2.3"
|
"typescript": "^4.9.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ else
|
|||||||
git pull origin --tags
|
git pull origin --tags
|
||||||
fi
|
fi
|
||||||
|
|
||||||
npm ci
|
npm install
|
||||||
|
|
||||||
mkdir ./lib
|
mkdir ./lib
|
||||||
npm run build
|
npm run build
|
||||||
|
|||||||
@@ -3,7 +3,11 @@
|
|||||||
"extends": [
|
"extends": [
|
||||||
"local>peaceiris/renovate-config"
|
"local>peaceiris/renovate-config"
|
||||||
],
|
],
|
||||||
"enabledManagers": [
|
"packageRules": [
|
||||||
"nvm"
|
{
|
||||||
|
"automerge": true,
|
||||||
|
"matchUpdateTypes": ["minor", "patch"],
|
||||||
|
"automergeStrategy": "squash"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,15 +127,19 @@ export async function setRepo(inps: Inputs, remoteURL: string, workDir: string):
|
|||||||
} else {
|
} else {
|
||||||
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
|
throw new Error(`Failed to clone remote branch ${inps.PublishBranch}`);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
if (error instanceof Error) {
|
||||||
core.info(`[INFO] ${e.message}`);
|
core.info(`[INFO] first deployment, create new branch ${inps.PublishBranch}`);
|
||||||
await createDir(destDir);
|
core.info(`[INFO] ${error.message}`);
|
||||||
core.info(`[INFO] chdir ${workDir}`);
|
await createDir(destDir);
|
||||||
process.chdir(workDir);
|
core.info(`[INFO] chdir ${workDir}`);
|
||||||
await createBranchForce(inps.PublishBranch);
|
process.chdir(workDir);
|
||||||
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
await createBranchForce(inps.PublishBranch);
|
||||||
return;
|
await copyAssets(publishDir, destDir, inps.ExcludeAssets);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,9 +205,13 @@ export async function commit(allowEmptyCommit: boolean, msg: string): Promise<vo
|
|||||||
} else {
|
} else {
|
||||||
await exec.exec('git', ['commit', '-m', `${msg}`]);
|
await exec.exec('git', ['commit', '-m', `${msg}`]);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
core.info('[INFO] skip commit');
|
if (error instanceof Error) {
|
||||||
core.debug(`[INFO] skip commit ${e.message}`);
|
core.info('[INFO] skip commit');
|
||||||
|
core.debug(`[INFO] skip commit ${error.message}`);
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ import * as main from './main';
|
|||||||
(async (): Promise<void> => {
|
(async (): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
await main.run();
|
await main.run();
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
core.setFailed(`Action failed with "${e.message}"`);
|
if (error instanceof Error) {
|
||||||
|
core.setFailed(`Action failed with "${error.message}"`);
|
||||||
|
} else {
|
||||||
|
core.setFailed('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
16
src/main.ts
16
src/main.ts
@@ -57,8 +57,12 @@ export async function run(): Promise<void> {
|
|||||||
core.startGroup('Setup Git config');
|
core.startGroup('Setup Git config');
|
||||||
try {
|
try {
|
||||||
await exec.exec('git', ['remote', 'rm', 'origin']);
|
await exec.exec('git', ['remote', 'rm', 'origin']);
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
core.info(`[INFO] ${e.message}`);
|
if (error instanceof Error) {
|
||||||
|
core.info(`[INFO] ${error.message}`);
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await exec.exec('git', ['remote', 'add', 'origin', remoteURL]);
|
await exec.exec('git', ['remote', 'add', 'origin', remoteURL]);
|
||||||
await exec.exec('git', ['add', '--all']);
|
await exec.exec('git', ['add', '--all']);
|
||||||
@@ -86,7 +90,11 @@ export async function run(): Promise<void> {
|
|||||||
core.info('[INFO] Action successfully completed');
|
core.info('[INFO] Action successfully completed');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
throw new Error(e.message);
|
if (error instanceof Error) {
|
||||||
|
throw new Error(error.message);
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export async function setSSHKey(inps: Inputs, publishRepo: string): Promise<stri
|
|||||||
# ${getServerUrl().host}.com:22 SSH-2.0-babeld-1f0633a6
|
# ${getServerUrl().host}.com:22 SSH-2.0-babeld-1f0633a6
|
||||||
${
|
${
|
||||||
getServerUrl().host
|
getServerUrl().host
|
||||||
} ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
|
} ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=
|
||||||
`;
|
`;
|
||||||
fs.writeFileSync(knownHosts, cmdSSHkeyscanOutput + '\n');
|
fs.writeFileSync(knownHosts, cmdSSHkeyscanOutput + '\n');
|
||||||
core.info(`[INFO] wrote ${knownHosts}`);
|
core.info(`[INFO] wrote ${knownHosts}`);
|
||||||
@@ -138,7 +138,11 @@ export async function setTokens(inps: Inputs): Promise<string> {
|
|||||||
} else {
|
} else {
|
||||||
throw new Error('not found deploy key or tokens');
|
throw new Error('not found deploy key or tokens');
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (error) {
|
||||||
throw new Error(e.message);
|
if (error instanceof Error) {
|
||||||
|
throw new Error(error.message);
|
||||||
|
} else {
|
||||||
|
throw new Error('unexpected error');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user