Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c56c9818a0 | ||
|
|
1c794ced3b | ||
|
|
0b7411e2cf | ||
|
|
750c807fa1 | ||
|
|
ae34186caa | ||
|
|
a5d411bf28 | ||
|
|
2875e4112a | ||
|
|
9d27fac8dc | ||
|
|
7501463241 | ||
|
|
b9cccec41e | ||
|
|
e782e1d323 | ||
|
|
c12a4b1908 | ||
|
|
dd1933a7b4 | ||
|
|
08093066ac | ||
|
|
c603e10bc1 | ||
|
|
5fe58fddba | ||
|
|
54a4434749 | ||
|
|
20d80bcd8c | ||
|
|
d9f616f4a2 | ||
|
|
e76c874d85 | ||
|
|
029c1a08f9 | ||
|
|
eafac7a3ef | ||
|
|
e4462d9bb6 | ||
|
|
91e6658ef0 | ||
|
|
714f710922 | ||
|
|
813be0645e | ||
|
|
a580dd75ed |
10
.github/ISSUE_TEMPLATE/1_user_support.md
vendored
10
.github/ISSUE_TEMPLATE/1_user_support.md
vendored
@@ -6,26 +6,26 @@ labels: support
|
||||
assignees: peaceiris
|
||||
---
|
||||
|
||||
**Check list before opening this issue**
|
||||
### Check list before opening this issue
|
||||
|
||||
- [ ] I read the latest README
|
||||
- I checked [Available Options](https://github.com/peaceiris/actions-gh-pages#options)
|
||||
- I followed [Tips and FAQ](https://github.com/peaceiris/actions-gh-pages#tips-and-faq)
|
||||
- I tried [Workflow Examples](https://github.com/peaceiris/actions-gh-pages#examples)
|
||||
|
||||
**Describe your question**
|
||||
### Describe your question
|
||||
|
||||
A clear and concise description of what the question is.
|
||||
|
||||
**Link to your contents**
|
||||
### Link to your contents
|
||||
|
||||
- Link to your public repository here
|
||||
- Link to your workflow here
|
||||
|
||||
**Screenshots**
|
||||
### Screenshots
|
||||
|
||||
If applicable, add screenshots to help explain your question.
|
||||
|
||||
**Additional context**
|
||||
### Additional context
|
||||
|
||||
Add any other context about the problem here.
|
||||
|
||||
18
.github/ISSUE_TEMPLATE/2_bug_report.md
vendored
18
.github/ISSUE_TEMPLATE/2_bug_report.md
vendored
@@ -7,25 +7,31 @@ assignees: peaceiris
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
### Describe the bug
|
||||
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
### To Reproduce
|
||||
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
### Expected behavior
|
||||
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
### Screenshots
|
||||
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Your YAML file**
|
||||
### Your YAML file
|
||||
|
||||
- A link to your repository
|
||||
- A link to your YAML file
|
||||
|
||||
**Additional context**
|
||||
### Additional context
|
||||
|
||||
Add any other context about the problem here.
|
||||
|
||||
12
.github/ISSUE_TEMPLATE/3_proposal.md
vendored
12
.github/ISSUE_TEMPLATE/3_proposal.md
vendored
@@ -7,14 +7,18 @@ assignees: peaceiris
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
### Is your feature request related to a problem? Please describe
|
||||
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
### Describe the solution you'd like
|
||||
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
### Describe alternatives you've considered
|
||||
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
### Additional context
|
||||
|
||||
Add any other context or screenshots about the feature request here.
|
||||
|
||||
110
.github/workflows/test.yml
vendored
110
.github/workflows/test.yml
vendored
@@ -26,6 +26,7 @@ jobs:
|
||||
matrix:
|
||||
os:
|
||||
- 'ubuntu-18.04'
|
||||
- 'ubuntu-16.04'
|
||||
- 'macos-latest'
|
||||
- 'windows-latest'
|
||||
steps:
|
||||
@@ -56,19 +57,19 @@ jobs:
|
||||
- run: npm ci
|
||||
|
||||
- name: Run prettier
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
if: startsWith(matrix.os, 'ubuntu-18.04')
|
||||
run: npm run format:check
|
||||
|
||||
- name: Run eslint
|
||||
if: startsWith(matrix.os, 'ubuntu')
|
||||
if: startsWith(matrix.os, 'ubuntu-18.04')
|
||||
run: npm run lint
|
||||
|
||||
- run: npm test
|
||||
|
||||
- name: Upload test coverage as artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: coverage
|
||||
name: coverage-${{ matrix.os }}
|
||||
path: coverage
|
||||
|
||||
- uses: codecov/codecov-action@v1
|
||||
@@ -88,7 +89,7 @@ jobs:
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: peaceiris/actions-mdbook@v1
|
||||
with:
|
||||
mdbook-version: '0.3.6'
|
||||
mdbook-version: '0.3.7'
|
||||
|
||||
- name: Build site
|
||||
if: github.ref == 'refs/heads/master'
|
||||
@@ -97,7 +98,7 @@ jobs:
|
||||
|
||||
- name: Deploy
|
||||
if: |
|
||||
startsWith(matrix.os, 'ubuntu') &&
|
||||
startsWith(matrix.os, 'ubuntu-18.04') &&
|
||||
github.ref == 'refs/heads/master'
|
||||
uses: ./
|
||||
with:
|
||||
@@ -114,6 +115,24 @@ jobs:
|
||||
# commit_message: ${{ github.event.head_commit.message }}
|
||||
cname: 'actions-gh-pages.peaceiris.com'
|
||||
|
||||
- name: Deploy
|
||||
if: |
|
||||
startsWith(matrix.os, 'ubuntu-16.04') &&
|
||||
github.ref == 'refs/heads/master'
|
||||
uses: ./
|
||||
with:
|
||||
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_branch: gh-pages-ubuntu-16.04
|
||||
publish_dir: ./test_projects/mdbook/book
|
||||
# external_repository: ''
|
||||
allow_empty_commit: true
|
||||
keep_files: true
|
||||
force_orphan: true
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||
full_commit_message: ${{ github.event.head_commit.message }}
|
||||
|
||||
- name: Deploy
|
||||
if: |
|
||||
startsWith(matrix.os, 'macos') &&
|
||||
@@ -151,3 +170,82 @@ jobs:
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||
# commit_message: ${{ github.event.head_commit.message }}
|
||||
|
||||
test-ubuntu-2004:
|
||||
runs-on: 'ubuntu-18.04'
|
||||
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
||||
container:
|
||||
image: 'ubuntu:20.04'
|
||||
steps:
|
||||
- name: Install deps
|
||||
run: |
|
||||
apt update
|
||||
apt install -y software-properties-common
|
||||
add-apt-repository ppa:git-core/ppa
|
||||
apt update
|
||||
apt install -y \
|
||||
git \
|
||||
ssh
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Dump GitHub context
|
||||
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@v1
|
||||
with:
|
||||
node-version: '${{ steps.nvm.outputs.NVMRC }}'
|
||||
|
||||
- run: npm i -g npm
|
||||
|
||||
- name: Dump version
|
||||
run: |
|
||||
node -v
|
||||
npm --version
|
||||
git --version
|
||||
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
|
||||
- name: Run ncc
|
||||
run: npm run build
|
||||
|
||||
- name: Remove lint-staged husky
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
npm uninstall lint-staged husky
|
||||
git checkout package-lock.json package.json
|
||||
|
||||
- name: Setup mdBook
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: peaceiris/actions-mdbook@v1
|
||||
with:
|
||||
mdbook-version: '0.3.7'
|
||||
|
||||
- name: Build site
|
||||
if: github.ref == 'refs/heads/master'
|
||||
working-directory: ./test_projects/mdbook
|
||||
run: mdbook build
|
||||
|
||||
- name: Deploy
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: ./
|
||||
with:
|
||||
# deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_branch: gh-pages-ubuntu-20.04
|
||||
publish_dir: ./test_projects/mdbook/book
|
||||
# external_repository: ''
|
||||
allow_empty_commit: true
|
||||
# keep_files: true
|
||||
# force_orphan: true
|
||||
user_name: 'github-actions[bot]'
|
||||
user_email: 'github-actions[bot]@users.noreply.github.com'
|
||||
# commit_message: ${{ github.event.head_commit.message }}
|
||||
|
||||
51
CHANGELOG.md
51
CHANGELOG.md
@@ -2,6 +2,57 @@
|
||||
|
||||
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.6.0](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.10...v3.6.0) (2020-05-04)
|
||||
|
||||
|
||||
### chore
|
||||
|
||||
* Enhance style ([750c807](https://github.com/peaceiris/actions-gh-pages/commit/750c807fa1ecf9d3d455cfd0fb5533442c660a1e))
|
||||
|
||||
### ci
|
||||
|
||||
* Add test-ubuntu-20.04 job (#270) ([7501463](https://github.com/peaceiris/actions-gh-pages/commit/75014632413b319cb87db5b3e54bba2d6a21ac05)), closes [#270](https://github.com/peaceiris/actions-gh-pages/issues/270) [#268](https://github.com/peaceiris/actions-gh-pages/issues/268)
|
||||
* use github_token ([9d27fac](https://github.com/peaceiris/actions-gh-pages/commit/9d27fac8dcdc50937d59b3068c59acf257ad2398))
|
||||
|
||||
### deps
|
||||
|
||||
* bump @actions/core from 1.2.3 to 1.2.4 (#265) ([dd1933a](https://github.com/peaceiris/actions-gh-pages/commit/dd1933a7b4b77a06b1995b0e8c40b6c219f32550)), closes [#265](https://github.com/peaceiris/actions-gh-pages/issues/265)
|
||||
* bump jest from 25.5.2 to 25.5.3 (#267) ([e782e1d](https://github.com/peaceiris/actions-gh-pages/commit/e782e1d32332c2e99058a039dd5caaf0533d0af6)), closes [#267](https://github.com/peaceiris/actions-gh-pages/issues/267)
|
||||
* bump jest from 25.5.3 to 25.5.4 (#272) ([ae34186](https://github.com/peaceiris/actions-gh-pages/commit/ae34186caa187c2960bae6d656f6ef69c6aa0fba)), closes [#272](https://github.com/peaceiris/actions-gh-pages/issues/272)
|
||||
* bump jest-circus from 25.5.2 to 25.5.3 (#266) ([c12a4b1](https://github.com/peaceiris/actions-gh-pages/commit/c12a4b1908457ab10af84e0947b66af3f868790c)), closes [#266](https://github.com/peaceiris/actions-gh-pages/issues/266)
|
||||
* bump jest-circus from 25.5.3 to 25.5.4 (#271) ([a5d411b](https://github.com/peaceiris/actions-gh-pages/commit/a5d411bf285983883daecb16787a8f6549da66d8)), closes [#271](https://github.com/peaceiris/actions-gh-pages/issues/271)
|
||||
* bump lint-staged from 10.2.0 to 10.2.1 (#264) ([0809306](https://github.com/peaceiris/actions-gh-pages/commit/08093066ac77639e402a4b60492a7759c395ba36)), closes [#264](https://github.com/peaceiris/actions-gh-pages/issues/264)
|
||||
* bump lint-staged from 10.2.1 to 10.2.2 (#269) ([b9cccec](https://github.com/peaceiris/actions-gh-pages/commit/b9cccec41e2e47ef704d34a7409dc07a50e32d46)), closes [#269](https://github.com/peaceiris/actions-gh-pages/issues/269)
|
||||
|
||||
### feat
|
||||
|
||||
* Add full_commit_message (#275) ([0b7411e](https://github.com/peaceiris/actions-gh-pages/commit/0b7411e2cf05b033f6766798560d02e932e01bd2)), closes [#275](https://github.com/peaceiris/actions-gh-pages/issues/275) [#274](https://github.com/peaceiris/actions-gh-pages/issues/274)
|
||||
|
||||
|
||||
|
||||
## [3.5.10](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.9...v3.5.10) (2020-04-30)
|
||||
|
||||
|
||||
### deps
|
||||
|
||||
* bump jest from 25.5.1 to 25.5.2 (#260) ([714f710](https://github.com/peaceiris/actions-gh-pages/commit/714f7109225b609d3303bb0cd6f459690a9165b6)), closes [#260](https://github.com/peaceiris/actions-gh-pages/issues/260)
|
||||
* bump jest-circus from 25.5.1 to 25.5.2 (#259) ([813be06](https://github.com/peaceiris/actions-gh-pages/commit/813be0645e175e6e475ada4f9cc922daeeade00a)), closes [#259](https://github.com/peaceiris/actions-gh-pages/issues/259)
|
||||
|
||||
### docs
|
||||
|
||||
* Add ubuntu-16.04 ([d9f616f](https://github.com/peaceiris/actions-gh-pages/commit/d9f616f4a278b6c334ce6dea09e69ba698459b38)), closes [#263](https://github.com/peaceiris/actions-gh-pages/issues/263)
|
||||
* bump actions/setup-python from v1 to v2 (#262) ([029c1a0](https://github.com/peaceiris/actions-gh-pages/commit/029c1a08f9594e3b2c581d78c258cc8e9c66f96c)), closes [#262](https://github.com/peaceiris/actions-gh-pages/issues/262)
|
||||
* bump python from 3.6 to 3.8 ([eafac7a](https://github.com/peaceiris/actions-gh-pages/commit/eafac7a3ef405ea76543c2c7995b64a19a1695c0))
|
||||
* change to job level defaults ([20d80bc](https://github.com/peaceiris/actions-gh-pages/commit/20d80bcd8cdfda9728f3c0befe2aa5052209ea50))
|
||||
* Enhance Python workflow example (#261) ([e4462d9](https://github.com/peaceiris/actions-gh-pages/commit/e4462d9bb679154cb07cca446c8e12c692610838)), closes [#261](https://github.com/peaceiris/actions-gh-pages/issues/261)
|
||||
* Enhance Supported Platforms ([91e6658](https://github.com/peaceiris/actions-gh-pages/commit/91e6658ef01bbd482a965675988a765faad5fce5))
|
||||
|
||||
### feat
|
||||
|
||||
* Support ubuntu-16.04 (#263) ([e76c874](https://github.com/peaceiris/actions-gh-pages/commit/e76c874d85f0c0e45f3602fe4a85a15feb87610c)), closes [#263](https://github.com/peaceiris/actions-gh-pages/issues/263)
|
||||
|
||||
|
||||
|
||||
## [3.5.9](https://github.com/peaceiris/actions-gh-pages/compare/v3.5.8...v3.5.9) (2020-04-29)
|
||||
|
||||
|
||||
|
||||
42
README.md
42
README.md
@@ -45,9 +45,12 @@ Notes: Actually, the `GITHUB_TOKEN` works for deploying to GitHub Pages but it h
|
||||
|
||||
### Supported Platforms
|
||||
|
||||
All Actions runners: Linux (Ubuntu), macOS, and Windows are supported.
|
||||
|
||||
| runs-on | `github_token` | `deploy_key` | `personal_token` |
|
||||
|---|:---:|:---:|:---:|
|
||||
| ubuntu-18.04 | ✅️ | ✅️ | ✅️ |
|
||||
| ubuntu-16.04 | ✅️ | ✅️ | ✅️ |
|
||||
| macos-latest | ✅️ | ✅️ | ✅️ |
|
||||
| windows-latest | ✅️ | (2) | ✅️ |
|
||||
|
||||
@@ -394,6 +397,18 @@ When we create a commit with a message `docs: Update some post`, a deployment co
|
||||
commit_message: ${{ github.event.head_commit.message }}
|
||||
```
|
||||
|
||||
To set a full custom commit message without a triggered commit hash,
|
||||
use the `full_commit_message` option instead of the `commit_message` option.
|
||||
|
||||
```yaml
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./public
|
||||
full_commit_message: ${{ github.event.head_commit.message }}
|
||||
```
|
||||
|
||||
### ⭐️ Create Git tag
|
||||
|
||||
Here is an example workflow.
|
||||
@@ -718,13 +733,12 @@ on:
|
||||
- '.github/workflows/deploy.yml'
|
||||
- 'website/**'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: website
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-18.04
|
||||
defaults:
|
||||
run:
|
||||
working-directory: website
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
@@ -780,23 +794,29 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v1
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.6'
|
||||
architecture: 'x64'
|
||||
python-version: '3.8'
|
||||
|
||||
- name: Upgrade pip
|
||||
run: |
|
||||
# install pip=>20.1 to use "pip cache dir"
|
||||
python3 -m pip install --upgrade pip
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -r ./requirements.txt
|
||||
run: python3 -m pip install -r ./requirements.txt
|
||||
|
||||
- run: mkdocs build
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ function getInputsLog(authMethod: string, inps: Inputs): string {
|
||||
[INFO] UserName: ${inps.UserName}
|
||||
[INFO] UserEmail: ${inps.UserEmail}
|
||||
[INFO] CommitMessage: ${inps.CommitMessage}
|
||||
[INFO] FullCommitMessage: ${inps.FullCommitMessage}
|
||||
[INFO] TagName: ${inps.TagName}
|
||||
[INFO] TagMessage: ${inps.TagMessage}
|
||||
[INFO] EnableJekyll (DisableNoJekyll): ${inps.DisableNoJekyll}
|
||||
@@ -117,6 +118,7 @@ describe('getInputs()', () => {
|
||||
expect(inps.UserName).toMatch('');
|
||||
expect(inps.UserEmail).toMatch('');
|
||||
expect(inps.CommitMessage).toMatch('');
|
||||
expect(inps.FullCommitMessage).toMatch('');
|
||||
expect(inps.TagName).toMatch('');
|
||||
expect(inps.TagMessage).toMatch('');
|
||||
expect(inps.DisableNoJekyll).toBe(false);
|
||||
@@ -136,6 +138,7 @@ describe('getInputs()', () => {
|
||||
process.env['INPUT_USER_NAME'] = 'username';
|
||||
process.env['INPUT_USER_EMAIL'] = 'github@github.com';
|
||||
process.env['INPUT_COMMIT_MESSAGE'] = 'feat: Add new feature';
|
||||
process.env['INPUT_FULL_COMMIT_MESSAGE'] = 'feat: Add new feature';
|
||||
process.env['INPUT_TAG_NAME'] = 'deploy-v1.2.3';
|
||||
process.env['INPUT_TAG_MESSAGE'] = 'Deployment v1.2.3';
|
||||
process.env['INPUT_DISABLE_NOJEKYLL'] = 'true';
|
||||
@@ -155,12 +158,19 @@ describe('getInputs()', () => {
|
||||
expect(inps.UserName).toMatch('username');
|
||||
expect(inps.UserEmail).toMatch('github@github.com');
|
||||
expect(inps.CommitMessage).toMatch('feat: Add new feature');
|
||||
expect(inps.FullCommitMessage).toMatch('feat: Add new feature');
|
||||
expect(inps.TagName).toMatch('deploy-v1.2.3');
|
||||
expect(inps.TagMessage).toMatch('Deployment v1.2.3');
|
||||
expect(inps.DisableNoJekyll).toBe(true);
|
||||
expect(inps.CNAME).toMatch('github.com');
|
||||
});
|
||||
|
||||
test('get spec inputs enable_jekyll', () => {
|
||||
process.env['INPUT_ENABLE_JEKYLL'] = 'true';
|
||||
const inps: Inputs = getInputs();
|
||||
expect(inps.DisableNoJekyll).toBe(true);
|
||||
});
|
||||
|
||||
test('throw error enable_jekyll or disable_nojekyll', () => {
|
||||
process.env['INPUT_DEPLOY_KEY'] = 'test_deploy_key';
|
||||
process.env['INPUT_ENABLE_JEKYLL'] = 'true';
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import {getUserName, getUserEmail, setCommitAuthor} from '../src/git-utils';
|
||||
import {
|
||||
getUserName,
|
||||
getUserEmail,
|
||||
setCommitAuthor,
|
||||
getCommitMessage
|
||||
} from '../src/git-utils';
|
||||
import {getWorkDirName, createWorkDir} from '../src/utils';
|
||||
import {CmdResult} from '../src/interfaces';
|
||||
import * as exec from '@actions/exec';
|
||||
@@ -114,3 +119,54 @@ describe('setCommitAuthor()', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getCommitMessage()', () => {
|
||||
test('get default message', () => {
|
||||
const test = getCommitMessage('', '', '', 'actions/pages', 'commit_hash');
|
||||
expect(test).toMatch('deploy: commit_hash');
|
||||
});
|
||||
|
||||
test('get default message for external repository', () => {
|
||||
const test = getCommitMessage(
|
||||
'',
|
||||
'',
|
||||
'actions/actions.github.io',
|
||||
'actions/pages',
|
||||
'commit_hash'
|
||||
);
|
||||
expect(test).toMatch('deploy: actions/pages@commit_hash');
|
||||
});
|
||||
|
||||
test('get custom message', () => {
|
||||
const test = getCommitMessage(
|
||||
'Custom msg',
|
||||
'',
|
||||
'',
|
||||
'actions/pages',
|
||||
'commit_hash'
|
||||
);
|
||||
expect(test).toMatch('Custom msg commit_hash');
|
||||
});
|
||||
|
||||
test('get custom message for external repository', () => {
|
||||
const test = getCommitMessage(
|
||||
'Custom msg',
|
||||
'',
|
||||
'actions/actions.github.io',
|
||||
'actions/pages',
|
||||
'commit_hash'
|
||||
);
|
||||
expect(test).toMatch('Custom msg actions/pages@commit_hash');
|
||||
});
|
||||
|
||||
test('get full custom message', () => {
|
||||
const test = getCommitMessage(
|
||||
'',
|
||||
'Full custom msg',
|
||||
'',
|
||||
'actions/pages',
|
||||
'commit_hash'
|
||||
);
|
||||
expect(test).toMatch('Full custom msg');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -47,7 +47,10 @@ inputs:
|
||||
description: 'Set Git user.email'
|
||||
required: false
|
||||
commit_message:
|
||||
description: 'Set custom commit message'
|
||||
description: 'Set a custom commit message with a triggered commit hash'
|
||||
required: false
|
||||
full_commit_message:
|
||||
description: 'Set a custom full commit message without a triggered commit hash'
|
||||
required: false
|
||||
tag_name:
|
||||
description: 'Set tag name'
|
||||
|
||||
File diff suppressed because one or more lines are too long
408
package-lock.json
generated
408
package-lock.json
generated
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "actions-github-pages",
|
||||
"version": "3.5.9",
|
||||
"version": "3.6.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@actions/core": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.3.tgz",
|
||||
"integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w=="
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz",
|
||||
"integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg=="
|
||||
},
|
||||
"@actions/exec": {
|
||||
"version": "1.0.4",
|
||||
@@ -439,9 +439,9 @@
|
||||
}
|
||||
},
|
||||
"@jest/core": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@jest/core/-/core-25.5.1.tgz",
|
||||
"integrity": "sha512-RxJuMJrcCbM0KzF8LQMxhVCN40EoCRwjd7g2mFDbTCxW+eW9gey3eLoDCicsSq5MR7FG5ms37LClPiba0kZnww==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@jest/core/-/core-25.5.4.tgz",
|
||||
"integrity": "sha512-3uSo7laYxF00Dg/DMgbn4xMJKmDdWvZnf89n8Xj/5/AeQ2dOQmn6b6Hkj/MleyzZWXpwv+WSdYWl4cLsy2JsoA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/console": "^25.5.0",
|
||||
@@ -454,14 +454,14 @@
|
||||
"exit": "^0.1.2",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-changed-files": "^25.5.0",
|
||||
"jest-config": "^25.5.1",
|
||||
"jest-config": "^25.5.4",
|
||||
"jest-haste-map": "^25.5.1",
|
||||
"jest-message-util": "^25.5.0",
|
||||
"jest-regex-util": "^25.2.6",
|
||||
"jest-resolve": "^25.5.1",
|
||||
"jest-resolve-dependencies": "^25.5.1",
|
||||
"jest-runner": "^25.5.1",
|
||||
"jest-runtime": "^25.5.1",
|
||||
"jest-resolve-dependencies": "^25.5.4",
|
||||
"jest-runner": "^25.5.4",
|
||||
"jest-runtime": "^25.5.4",
|
||||
"jest-snapshot": "^25.5.1",
|
||||
"jest-util": "^25.5.0",
|
||||
"jest-validate": "^25.5.0",
|
||||
@@ -600,9 +600,9 @@
|
||||
}
|
||||
},
|
||||
"@jest/globals": {
|
||||
"version": "25.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@jest/globals/-/globals-25.5.0.tgz",
|
||||
"integrity": "sha512-yC+WlD1ytYPZvTSbmSeZM+BNbkFXtkTBBjtmoFDYxjznwugl2Qv2KW7csxL7nTxJOxyjkffy6ngLZ6YMqAe7MA==",
|
||||
"version": "25.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@jest/globals/-/globals-25.5.2.tgz",
|
||||
"integrity": "sha512-AgAS/Ny7Q2RCIj5kZ+0MuKM1wbF0WMLxbCVl/GOMoCNbODRdJ541IxJ98xnZdVSZXivKpJlNPIWa3QmY0l4CXA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/environment": "^25.5.0",
|
||||
@@ -621,78 +621,6 @@
|
||||
"@types/yargs": "^15.0.0",
|
||||
"chalk": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"expect": {
|
||||
"version": "25.5.0",
|
||||
"resolved": "https://registry.npmjs.org/expect/-/expect-25.5.0.tgz",
|
||||
"integrity": "sha512-w7KAXo0+6qqZZhovCaBVPSIqQp7/UTcx4M9uKt2m6pd2VB1voyC8JizLRqeEqud3AAVP02g+hbErDu5gu64tlA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/types": "^25.5.0",
|
||||
"ansi-styles": "^4.0.0",
|
||||
"jest-get-type": "^25.2.6",
|
||||
"jest-matcher-utils": "^25.5.0",
|
||||
"jest-message-util": "^25.5.0",
|
||||
"jest-regex-util": "^25.2.6"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
|
||||
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
|
||||
"dev": true
|
||||
},
|
||||
"jest-diff": {
|
||||
"version": "25.5.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.5.0.tgz",
|
||||
"integrity": "sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^3.0.0",
|
||||
"diff-sequences": "^25.2.6",
|
||||
"jest-get-type": "^25.2.6",
|
||||
"pretty-format": "^25.5.0"
|
||||
}
|
||||
},
|
||||
"jest-matcher-utils": {
|
||||
"version": "25.5.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-25.5.0.tgz",
|
||||
"integrity": "sha512-VWI269+9JS5cpndnpCwm7dy7JtGQT30UHfrnM3mXl22gHGt/b7NkjBqXfbhZ8V4B7ANUsjK18PlSBmG0YH7gjw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^3.0.0",
|
||||
"jest-diff": "^25.5.0",
|
||||
"jest-get-type": "^25.2.6",
|
||||
"pretty-format": "^25.5.0"
|
||||
}
|
||||
},
|
||||
"jest-message-util": {
|
||||
"version": "25.5.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-25.5.0.tgz",
|
||||
"integrity": "sha512-ezddz3YCT/LT0SKAmylVyWWIGYoKHOFOFXx3/nA4m794lfVUskMcwhip6vTgdVrOtYdjeQeis2ypzes9mZb4EA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@jest/types": "^25.5.0",
|
||||
"@types/stack-utils": "^1.0.1",
|
||||
"chalk": "^3.0.0",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"micromatch": "^4.0.2",
|
||||
"slash": "^3.0.0",
|
||||
"stack-utils": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"pretty-format": {
|
||||
"version": "25.5.0",
|
||||
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz",
|
||||
"integrity": "sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/types": "^25.5.0",
|
||||
"ansi-regex": "^5.0.0",
|
||||
"ansi-styles": "^4.0.0",
|
||||
"react-is": "^16.12.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -795,16 +723,16 @@
|
||||
}
|
||||
},
|
||||
"@jest/test-sequencer": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-25.5.1.tgz",
|
||||
"integrity": "sha512-XcnGwXFfs194AKO3M8xRsDLwo72LzuLuhOjd9e7AaBe5kEZk8fbGRxE7pQSqHyL49xV/NCCXUtBJ9lDqt1NLnw==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-25.5.4.tgz",
|
||||
"integrity": "sha512-pTJGEkSeg1EkCO2YWq6hbFvKNXk8ejqlxiOg1jBNLnWrgXOkdY6UmqZpwGFXNnRt9B8nO1uWMzLLZ4eCmhkPNA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/test-result": "^25.5.0",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-haste-map": "^25.5.1",
|
||||
"jest-runner": "^25.5.1",
|
||||
"jest-runtime": "^25.5.1"
|
||||
"jest-runner": "^25.5.4",
|
||||
"jest-runtime": "^25.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"graceful-fs": {
|
||||
@@ -4268,14 +4196,14 @@
|
||||
}
|
||||
},
|
||||
"jest": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest/-/jest-25.5.1.tgz",
|
||||
"integrity": "sha512-8ouk/Av1maBODIC17GNZiIYc61SSWMds5d7HtPMXtz1CguqE+OXh4Ma2O8UvqZ/yTvYInhVKD2xVEa+VewjErQ==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest/-/jest-25.5.4.tgz",
|
||||
"integrity": "sha512-hHFJROBTqZahnO+X+PMtT6G2/ztqAZJveGqz//FnWWHurizkD05PQGzRZOhF3XP6z7SJmL+5tCfW8qV06JypwQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/core": "^25.5.1",
|
||||
"@jest/core": "^25.5.4",
|
||||
"import-local": "^3.0.2",
|
||||
"jest-cli": "^25.5.1"
|
||||
"jest-cli": "^25.5.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/types": {
|
||||
@@ -4297,12 +4225,12 @@
|
||||
"dev": true
|
||||
},
|
||||
"jest-cli": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-25.5.1.tgz",
|
||||
"integrity": "sha512-zXbztzrZEPnqHNHr4A/PELE+fZDB8zcWfNKV11YDzXphkaSztjsX2cFtkx5bcW3Ya23JRzUw6KcaIgccLXAnSg==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-25.5.4.tgz",
|
||||
"integrity": "sha512-rG8uJkIiOUpnREh1768/N3n27Cm+xPFkSNFO91tgg+8o2rXeVLStz+vkXkGr4UtzH6t1SNbjwoiswd7p4AhHTw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/core": "^25.5.1",
|
||||
"@jest/core": "^25.5.4",
|
||||
"@jest/test-result": "^25.5.0",
|
||||
"@jest/types": "^25.5.0",
|
||||
"chalk": "^3.0.0",
|
||||
@@ -4310,7 +4238,7 @@
|
||||
"graceful-fs": "^4.2.4",
|
||||
"import-local": "^3.0.2",
|
||||
"is-ci": "^2.0.0",
|
||||
"jest-config": "^25.5.1",
|
||||
"jest-config": "^25.5.4",
|
||||
"jest-util": "^25.5.0",
|
||||
"jest-validate": "^25.5.0",
|
||||
"prompts": "^2.0.1",
|
||||
@@ -4435,9 +4363,9 @@
|
||||
}
|
||||
},
|
||||
"jest-circus": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-25.5.1.tgz",
|
||||
"integrity": "sha512-eVRyGIoYFy198ngvZBlZ5i9G+WUxMyCEW62tydCDBqp+X39IgSLBkMRIwtpVvS5f9+aSmpQ4tsSEcpvoUTqzeA==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-25.5.4.tgz",
|
||||
"integrity": "sha512-nOLJXZjWuV2i8yQ2w+MZ8NhFuqrbgpPAa4mh+DWPYmNI377YYpDKvDUrLMW8U1sa2iGt5mjKQbmJz2SK9AYjWg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/traverse": "^7.1.0",
|
||||
@@ -4451,7 +4379,7 @@
|
||||
"jest-each": "^25.5.0",
|
||||
"jest-matcher-utils": "^25.5.0",
|
||||
"jest-message-util": "^25.5.0",
|
||||
"jest-runtime": "^25.5.1",
|
||||
"jest-runtime": "^25.5.4",
|
||||
"jest-snapshot": "^25.5.1",
|
||||
"jest-util": "^25.5.0",
|
||||
"pretty-format": "^25.5.0",
|
||||
@@ -4460,40 +4388,16 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/test-sequencer": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-25.5.1.tgz",
|
||||
"integrity": "sha512-XcnGwXFfs194AKO3M8xRsDLwo72LzuLuhOjd9e7AaBe5kEZk8fbGRxE7pQSqHyL49xV/NCCXUtBJ9lDqt1NLnw==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-25.5.4.tgz",
|
||||
"integrity": "sha512-pTJGEkSeg1EkCO2YWq6hbFvKNXk8ejqlxiOg1jBNLnWrgXOkdY6UmqZpwGFXNnRt9B8nO1uWMzLLZ4eCmhkPNA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/test-result": "^25.5.0",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-haste-map": "^25.5.1",
|
||||
"jest-runner": "^25.5.1",
|
||||
"jest-runtime": "^25.5.1"
|
||||
}
|
||||
},
|
||||
"@jest/transform": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@jest/transform/-/transform-25.5.1.tgz",
|
||||
"integrity": "sha512-Y8CEoVwXb4QwA6Y/9uDkn0Xfz0finGkieuV0xkdF9UtZGJeLukD5nLkaVrVsODB1ojRWlaoD0AJZpVHCSnJEvg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/core": "^7.1.0",
|
||||
"@jest/types": "^25.5.0",
|
||||
"babel-plugin-istanbul": "^6.0.0",
|
||||
"chalk": "^3.0.0",
|
||||
"convert-source-map": "^1.4.0",
|
||||
"fast-json-stable-stringify": "^2.0.0",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-haste-map": "^25.5.1",
|
||||
"jest-regex-util": "^25.2.6",
|
||||
"jest-util": "^25.5.0",
|
||||
"micromatch": "^4.0.2",
|
||||
"pirates": "^4.0.1",
|
||||
"realpath-native": "^2.0.0",
|
||||
"slash": "^3.0.0",
|
||||
"source-map": "^0.6.1",
|
||||
"write-file-atomic": "^3.0.0"
|
||||
"jest-runner": "^25.5.4",
|
||||
"jest-runtime": "^25.5.4"
|
||||
}
|
||||
},
|
||||
"@jest/types": {
|
||||
@@ -4508,22 +4412,6 @@
|
||||
"chalk": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"babel-jest": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-25.5.1.tgz",
|
||||
"integrity": "sha512-9dA9+GmMjIzgPnYtkhBg73gOo/RHqPmLruP3BaGL4KEX3Dwz6pI8auSN8G8+iuEG90+GSswyKvslN+JYSaacaQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/transform": "^25.5.1",
|
||||
"@jest/types": "^25.5.0",
|
||||
"@types/babel__core": "^7.1.7",
|
||||
"babel-plugin-istanbul": "^6.0.0",
|
||||
"babel-preset-jest": "^25.5.0",
|
||||
"chalk": "^3.0.0",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"slash": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
|
||||
@@ -4531,13 +4419,13 @@
|
||||
"dev": true
|
||||
},
|
||||
"jest-config": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-config/-/jest-config-25.5.1.tgz",
|
||||
"integrity": "sha512-doUA9VEge7u28PvZNe7qkqG/NUAAObqLv8faMsaEiY2koZFtSTtcwCRoQQXsBU6w3lRRTOSg4LLchZERZLbOfA==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-config/-/jest-config-25.5.4.tgz",
|
||||
"integrity": "sha512-SZwR91SwcdK6bz7Gco8qL7YY2sx8tFJYzvg216DLihTWf+LKY/DoJXpM9nTzYakSyfblbqeU48p/p7Jzy05Atg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/core": "^7.1.0",
|
||||
"@jest/test-sequencer": "^25.5.1",
|
||||
"@jest/test-sequencer": "^25.5.4",
|
||||
"@jest/types": "^25.5.0",
|
||||
"babel-jest": "^25.5.1",
|
||||
"chalk": "^3.0.0",
|
||||
@@ -4547,7 +4435,7 @@
|
||||
"jest-environment-jsdom": "^25.5.0",
|
||||
"jest-environment-node": "^25.5.0",
|
||||
"jest-get-type": "^25.2.6",
|
||||
"jest-jasmine2": "^25.5.1",
|
||||
"jest-jasmine2": "^25.5.4",
|
||||
"jest-regex-util": "^25.2.6",
|
||||
"jest-resolve": "^25.5.1",
|
||||
"jest-util": "^25.5.0",
|
||||
@@ -4557,43 +4445,10 @@
|
||||
"realpath-native": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"jest-diff": {
|
||||
"version": "25.5.0",
|
||||
"resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-25.5.0.tgz",
|
||||
"integrity": "sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^3.0.0",
|
||||
"diff-sequences": "^25.2.6",
|
||||
"jest-get-type": "^25.2.6",
|
||||
"pretty-format": "^25.5.0"
|
||||
}
|
||||
},
|
||||
"jest-haste-map": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-25.5.1.tgz",
|
||||
"integrity": "sha512-dddgh9UZjV7SCDQUrQ+5t9yy8iEgKc1AKqZR9YDww8xsVOtzPQSMVLDChc21+g29oTRexb9/B0bIlZL+sWmvAQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/types": "^25.5.0",
|
||||
"@types/graceful-fs": "^4.1.2",
|
||||
"anymatch": "^3.0.3",
|
||||
"fb-watchman": "^2.0.0",
|
||||
"fsevents": "^2.1.2",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-serializer": "^25.5.0",
|
||||
"jest-util": "^25.5.0",
|
||||
"jest-worker": "^25.5.0",
|
||||
"micromatch": "^4.0.2",
|
||||
"sane": "^4.0.3",
|
||||
"walker": "^1.0.7",
|
||||
"which": "^2.0.2"
|
||||
}
|
||||
},
|
||||
"jest-jasmine2": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-25.5.1.tgz",
|
||||
"integrity": "sha512-CydSULT9iqLX55OofjjtinYWHlC1HT3FijkelOZzUPwq2EN8aNAAYGdyaKjXEHJfhKmVD531GxA2F4q1Phmaxw==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-25.5.4.tgz",
|
||||
"integrity": "sha512-9acbWEfbmS8UpdcfqnDO+uBUgKa/9hcRh983IHdM+pKmJPL77G0sWAAK0V0kr5LK3a8cSBfkFSoncXwQlRZfkQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/traverse": "^7.1.0",
|
||||
@@ -4608,34 +4463,17 @@
|
||||
"jest-each": "^25.5.0",
|
||||
"jest-matcher-utils": "^25.5.0",
|
||||
"jest-message-util": "^25.5.0",
|
||||
"jest-runtime": "^25.5.1",
|
||||
"jest-runtime": "^25.5.4",
|
||||
"jest-snapshot": "^25.5.1",
|
||||
"jest-util": "^25.5.0",
|
||||
"pretty-format": "^25.5.0",
|
||||
"throat": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"jest-resolve": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-25.5.1.tgz",
|
||||
"integrity": "sha512-Hc09hYch5aWdtejsUZhA+vSzcotf7fajSlPA6EZPE1RmPBAD39XtJhvHWFStid58iit4IPDLI/Da4cwdDmAHiQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/types": "^25.5.0",
|
||||
"browser-resolve": "^1.11.3",
|
||||
"chalk": "^3.0.0",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-pnp-resolver": "^1.2.1",
|
||||
"read-pkg-up": "^7.0.1",
|
||||
"realpath-native": "^2.0.0",
|
||||
"resolve": "^1.17.0",
|
||||
"slash": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"jest-runner": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-25.5.1.tgz",
|
||||
"integrity": "sha512-CBYKwUENc5ya1sJcFPyp5sMl3Otbj9lfulVP15gcLPsfRqk5cA72Qhm3Y5hdULs6WvsP8ATdihYPMzrESJJHFw==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-25.5.4.tgz",
|
||||
"integrity": "sha512-V/2R7fKZo6blP8E9BL9vJ8aTU4TH2beuqGNxHbxi6t14XzTb+x90B3FRgdvuHm41GY8ch4xxvf0ATH4hdpjTqg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/console": "^25.5.0",
|
||||
@@ -4645,14 +4483,14 @@
|
||||
"chalk": "^3.0.0",
|
||||
"exit": "^0.1.2",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-config": "^25.5.1",
|
||||
"jest-config": "^25.5.4",
|
||||
"jest-docblock": "^25.3.0",
|
||||
"jest-haste-map": "^25.5.1",
|
||||
"jest-jasmine2": "^25.5.1",
|
||||
"jest-jasmine2": "^25.5.4",
|
||||
"jest-leak-detector": "^25.5.0",
|
||||
"jest-message-util": "^25.5.0",
|
||||
"jest-resolve": "^25.5.1",
|
||||
"jest-runtime": "^25.5.1",
|
||||
"jest-runtime": "^25.5.4",
|
||||
"jest-util": "^25.5.0",
|
||||
"jest-worker": "^25.5.0",
|
||||
"source-map-support": "^0.5.6",
|
||||
@@ -4660,14 +4498,14 @@
|
||||
}
|
||||
},
|
||||
"jest-runtime": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-25.5.1.tgz",
|
||||
"integrity": "sha512-C8neT+c1k/Sr0HlsLJqZgQmmBI5Plyh3FHfO5VF/K670/V/gAN375WQwwIzbTevK3nbOl7NzuKxS2A3Ps5SLgg==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-25.5.4.tgz",
|
||||
"integrity": "sha512-RWTt8LeWh3GvjYtASH2eezkc8AehVoWKK20udV6n3/gC87wlTbE1kIA+opCvNWyyPeBs6ptYsc6nyHUb1GlUVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/console": "^25.5.0",
|
||||
"@jest/environment": "^25.5.0",
|
||||
"@jest/globals": "^25.5.0",
|
||||
"@jest/globals": "^25.5.2",
|
||||
"@jest/source-map": "^25.5.0",
|
||||
"@jest/test-result": "^25.5.0",
|
||||
"@jest/transform": "^25.5.1",
|
||||
@@ -4678,7 +4516,7 @@
|
||||
"exit": "^0.1.2",
|
||||
"glob": "^7.1.3",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-config": "^25.5.1",
|
||||
"jest-config": "^25.5.4",
|
||||
"jest-haste-map": "^25.5.1",
|
||||
"jest-message-util": "^25.5.0",
|
||||
"jest-mock": "^25.5.0",
|
||||
@@ -4693,29 +4531,6 @@
|
||||
"yargs": "^15.3.1"
|
||||
}
|
||||
},
|
||||
"jest-snapshot": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-25.5.1.tgz",
|
||||
"integrity": "sha512-C02JE1TUe64p2v1auUJ2ze5vcuv32tkv9PyhEb318e8XOKF7MOyXdJ7kdjbvrp3ChPLU2usI7Rjxs97Dj5P0uQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "^7.0.0",
|
||||
"@jest/types": "^25.5.0",
|
||||
"@types/prettier": "^1.19.0",
|
||||
"chalk": "^3.0.0",
|
||||
"expect": "^25.5.0",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-diff": "^25.5.0",
|
||||
"jest-get-type": "^25.2.6",
|
||||
"jest-matcher-utils": "^25.5.0",
|
||||
"jest-message-util": "^25.5.0",
|
||||
"jest-resolve": "^25.5.1",
|
||||
"make-dir": "^3.0.0",
|
||||
"natural-compare": "^1.4.0",
|
||||
"pretty-format": "^25.5.0",
|
||||
"semver": "^6.3.0"
|
||||
}
|
||||
},
|
||||
"pretty-format": {
|
||||
"version": "25.5.0",
|
||||
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-25.5.0.tgz",
|
||||
@@ -4727,72 +4542,17 @@
|
||||
"ansi-styles": "^4.0.0",
|
||||
"react-is": "^16.12.0"
|
||||
}
|
||||
},
|
||||
"read-pkg": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz",
|
||||
"integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/normalize-package-data": "^2.4.0",
|
||||
"normalize-package-data": "^2.5.0",
|
||||
"parse-json": "^5.0.0",
|
||||
"type-fest": "^0.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"type-fest": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
|
||||
"integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"read-pkg-up": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz",
|
||||
"integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-up": "^4.1.0",
|
||||
"read-pkg": "^5.2.0",
|
||||
"type-fest": "^0.8.1"
|
||||
}
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.17.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz",
|
||||
"integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"path-parse": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"dev": true
|
||||
},
|
||||
"which": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"jest-config": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-config/-/jest-config-25.5.1.tgz",
|
||||
"integrity": "sha512-doUA9VEge7u28PvZNe7qkqG/NUAAObqLv8faMsaEiY2koZFtSTtcwCRoQQXsBU6w3lRRTOSg4LLchZERZLbOfA==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-config/-/jest-config-25.5.4.tgz",
|
||||
"integrity": "sha512-SZwR91SwcdK6bz7Gco8qL7YY2sx8tFJYzvg216DLihTWf+LKY/DoJXpM9nTzYakSyfblbqeU48p/p7Jzy05Atg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/core": "^7.1.0",
|
||||
"@jest/test-sequencer": "^25.5.1",
|
||||
"@jest/test-sequencer": "^25.5.4",
|
||||
"@jest/types": "^25.5.0",
|
||||
"babel-jest": "^25.5.1",
|
||||
"chalk": "^3.0.0",
|
||||
@@ -4802,7 +4562,7 @@
|
||||
"jest-environment-jsdom": "^25.5.0",
|
||||
"jest-environment-node": "^25.5.0",
|
||||
"jest-get-type": "^25.2.6",
|
||||
"jest-jasmine2": "^25.5.1",
|
||||
"jest-jasmine2": "^25.5.4",
|
||||
"jest-regex-util": "^25.2.6",
|
||||
"jest-resolve": "^25.5.1",
|
||||
"jest-util": "^25.5.0",
|
||||
@@ -5080,9 +4840,9 @@
|
||||
}
|
||||
},
|
||||
"jest-jasmine2": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-25.5.1.tgz",
|
||||
"integrity": "sha512-CydSULT9iqLX55OofjjtinYWHlC1HT3FijkelOZzUPwq2EN8aNAAYGdyaKjXEHJfhKmVD531GxA2F4q1Phmaxw==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-25.5.4.tgz",
|
||||
"integrity": "sha512-9acbWEfbmS8UpdcfqnDO+uBUgKa/9hcRh983IHdM+pKmJPL77G0sWAAK0V0kr5LK3a8cSBfkFSoncXwQlRZfkQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/traverse": "^7.1.0",
|
||||
@@ -5097,7 +4857,7 @@
|
||||
"jest-each": "^25.5.0",
|
||||
"jest-matcher-utils": "^25.5.0",
|
||||
"jest-message-util": "^25.5.0",
|
||||
"jest-runtime": "^25.5.1",
|
||||
"jest-runtime": "^25.5.4",
|
||||
"jest-snapshot": "^25.5.1",
|
||||
"jest-util": "^25.5.0",
|
||||
"pretty-format": "^25.5.0",
|
||||
@@ -5365,9 +5125,9 @@
|
||||
}
|
||||
},
|
||||
"jest-resolve-dependencies": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-25.5.1.tgz",
|
||||
"integrity": "sha512-0lJr2rg1dfruCAUK9hk9RAnQchj36W7Vg2X+81McZI3TTihJsa5Mwa8u4eycxRKrZjP8lGMsO+2+z49H6qA4Ug==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-25.5.4.tgz",
|
||||
"integrity": "sha512-yFmbPd+DAQjJQg88HveObcGBA32nqNZ02fjYmtL16t1xw9bAttSn5UGRRhzMHIQbsep7znWvAvnD4kDqOFM0Uw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/types": "^25.5.0",
|
||||
@@ -5390,9 +5150,9 @@
|
||||
}
|
||||
},
|
||||
"jest-runner": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-25.5.1.tgz",
|
||||
"integrity": "sha512-CBYKwUENc5ya1sJcFPyp5sMl3Otbj9lfulVP15gcLPsfRqk5cA72Qhm3Y5hdULs6WvsP8ATdihYPMzrESJJHFw==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-25.5.4.tgz",
|
||||
"integrity": "sha512-V/2R7fKZo6blP8E9BL9vJ8aTU4TH2beuqGNxHbxi6t14XzTb+x90B3FRgdvuHm41GY8ch4xxvf0ATH4hdpjTqg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/console": "^25.5.0",
|
||||
@@ -5402,14 +5162,14 @@
|
||||
"chalk": "^3.0.0",
|
||||
"exit": "^0.1.2",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-config": "^25.5.1",
|
||||
"jest-config": "^25.5.4",
|
||||
"jest-docblock": "^25.3.0",
|
||||
"jest-haste-map": "^25.5.1",
|
||||
"jest-jasmine2": "^25.5.1",
|
||||
"jest-jasmine2": "^25.5.4",
|
||||
"jest-leak-detector": "^25.5.0",
|
||||
"jest-message-util": "^25.5.0",
|
||||
"jest-resolve": "^25.5.1",
|
||||
"jest-runtime": "^25.5.1",
|
||||
"jest-runtime": "^25.5.4",
|
||||
"jest-util": "^25.5.0",
|
||||
"jest-worker": "^25.5.0",
|
||||
"source-map-support": "^0.5.6",
|
||||
@@ -5437,14 +5197,14 @@
|
||||
}
|
||||
},
|
||||
"jest-runtime": {
|
||||
"version": "25.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-25.5.1.tgz",
|
||||
"integrity": "sha512-C8neT+c1k/Sr0HlsLJqZgQmmBI5Plyh3FHfO5VF/K670/V/gAN375WQwwIzbTevK3nbOl7NzuKxS2A3Ps5SLgg==",
|
||||
"version": "25.5.4",
|
||||
"resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-25.5.4.tgz",
|
||||
"integrity": "sha512-RWTt8LeWh3GvjYtASH2eezkc8AehVoWKK20udV6n3/gC87wlTbE1kIA+opCvNWyyPeBs6ptYsc6nyHUb1GlUVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jest/console": "^25.5.0",
|
||||
"@jest/environment": "^25.5.0",
|
||||
"@jest/globals": "^25.5.0",
|
||||
"@jest/globals": "^25.5.2",
|
||||
"@jest/source-map": "^25.5.0",
|
||||
"@jest/test-result": "^25.5.0",
|
||||
"@jest/transform": "^25.5.1",
|
||||
@@ -5455,7 +5215,7 @@
|
||||
"exit": "^0.1.2",
|
||||
"glob": "^7.1.3",
|
||||
"graceful-fs": "^4.2.4",
|
||||
"jest-config": "^25.5.1",
|
||||
"jest-config": "^25.5.4",
|
||||
"jest-haste-map": "^25.5.1",
|
||||
"jest-message-util": "^25.5.0",
|
||||
"jest-mock": "^25.5.0",
|
||||
@@ -5853,9 +5613,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"lint-staged": {
|
||||
"version": "10.2.0",
|
||||
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.2.0.tgz",
|
||||
"integrity": "sha512-4Dw2XMtEOGpICl0wvicE5KT/eFlt/kmwMmpNS4v09I/ywRWuR5udbMWjdfZez24jE6r0bQmPpkLZ1+wUGE1S+w==",
|
||||
"version": "10.2.2",
|
||||
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.2.2.tgz",
|
||||
"integrity": "sha512-78kNqNdDeKrnqWsexAmkOU3Z5wi+1CsQmUmfCuYgMTE8E4rAIX8RHW7xgxwAZ+LAayb7Cca4uYX4P3LlevzjVg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "^4.0.0",
|
||||
|
||||
10
package.json
10
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "actions-github-pages",
|
||||
"version": "3.5.9",
|
||||
"version": "3.6.0",
|
||||
"description": "GitHub Actions for GitHub Pages",
|
||||
"main": "lib/index.js",
|
||||
"engines": {
|
||||
@@ -54,7 +54,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/peaceiris/actions-gh-pages#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.3",
|
||||
"@actions/core": "^1.2.4",
|
||||
"@actions/exec": "^1.0.4",
|
||||
"@actions/github": "^2.1.1",
|
||||
"@actions/io": "^1.0.2"
|
||||
@@ -69,10 +69,10 @@
|
||||
"eslint": "^6.8.0",
|
||||
"eslint-plugin-jest": "^23.8.2",
|
||||
"husky": "^4.2.5",
|
||||
"jest": "^25.5.1",
|
||||
"jest-circus": "^25.5.1",
|
||||
"jest": "^25.5.4",
|
||||
"jest-circus": "^25.5.4",
|
||||
"js-yaml": "^3.13.1",
|
||||
"lint-staged": "^10.2.0",
|
||||
"lint-staged": "^10.2.2",
|
||||
"prettier": "2.0.5",
|
||||
"standard-version": "^7.1.0",
|
||||
"ts-jest": "^25.4.0",
|
||||
|
||||
@@ -22,6 +22,7 @@ export function showInputs(inps: Inputs): void {
|
||||
[INFO] UserName: ${inps.UserName}
|
||||
[INFO] UserEmail: ${inps.UserEmail}
|
||||
[INFO] CommitMessage: ${inps.CommitMessage}
|
||||
[INFO] FullCommitMessage: ${inps.FullCommitMessage}
|
||||
[INFO] TagName: ${inps.TagName}
|
||||
[INFO] TagMessage: ${inps.TagMessage}
|
||||
[INFO] EnableJekyll (DisableNoJekyll): ${inps.DisableNoJekyll}
|
||||
@@ -61,6 +62,7 @@ export function getInputs(): Inputs {
|
||||
UserName: core.getInput('user_name'),
|
||||
UserEmail: core.getInput('user_email'),
|
||||
CommitMessage: core.getInput('commit_message'),
|
||||
FullCommitMessage: core.getInput('full_commit_message'),
|
||||
TagName: core.getInput('tag_name'),
|
||||
TagMessage: core.getInput('tag_message'),
|
||||
DisableNoJekyll: useBuiltinJekyll,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as github from '@actions/github';
|
||||
import * as io from '@actions/io';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
@@ -133,26 +132,38 @@ export async function setCommitAuthor(
|
||||
await exec.exec('git', ['config', 'user.email', getUserEmail(userEmail)]);
|
||||
}
|
||||
|
||||
export function getCommitMessage(
|
||||
msg: string,
|
||||
fullMsg: string,
|
||||
extRepo: string,
|
||||
baseRepo: string,
|
||||
hash: string
|
||||
): string {
|
||||
const msgHash = ((): string => {
|
||||
if (extRepo) {
|
||||
return `${baseRepo}@${hash}`;
|
||||
} else {
|
||||
return hash;
|
||||
}
|
||||
})();
|
||||
|
||||
const subject = ((): string => {
|
||||
if (fullMsg) {
|
||||
return fullMsg;
|
||||
} else if (msg) {
|
||||
return `${msg} ${msgHash}`;
|
||||
} else {
|
||||
return `deploy: ${msgHash}`;
|
||||
}
|
||||
})();
|
||||
|
||||
return subject;
|
||||
}
|
||||
|
||||
export async function commit(
|
||||
allowEmptyCommit: boolean,
|
||||
externalRepository: string,
|
||||
message: string
|
||||
msg: string
|
||||
): Promise<void> {
|
||||
let msg = '';
|
||||
if (message) {
|
||||
msg = message;
|
||||
} else {
|
||||
msg = 'deploy:';
|
||||
}
|
||||
|
||||
const hash = `${process.env.GITHUB_SHA}`;
|
||||
const baseRepo = `${github.context.repo.owner}/${github.context.repo.repo}`;
|
||||
if (externalRepository) {
|
||||
msg = `${msg} ${baseRepo}@${hash}`;
|
||||
} else {
|
||||
msg = `${msg} ${hash}`;
|
||||
}
|
||||
|
||||
try {
|
||||
if (allowEmptyCommit) {
|
||||
await exec.exec('git', ['commit', '--allow-empty', '-m', `${msg}`]);
|
||||
|
||||
@@ -11,6 +11,7 @@ export interface Inputs {
|
||||
readonly UserName: string;
|
||||
readonly UserEmail: string;
|
||||
readonly CommitMessage: string;
|
||||
readonly FullCommitMessage: string;
|
||||
readonly TagName: string;
|
||||
readonly TagMessage: string;
|
||||
readonly DisableNoJekyll: boolean;
|
||||
|
||||
21
src/main.ts
21
src/main.ts
@@ -1,10 +1,18 @@
|
||||
import {context} from '@actions/github';
|
||||
import * as core from '@actions/core';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as github from '@actions/github';
|
||||
import {Inputs} from './interfaces';
|
||||
import {showInputs, getInputs} from './get-inputs';
|
||||
import {setTokens} from './set-tokens';
|
||||
import {setRepo, setCommitAuthor, commit, push, pushTag} from './git-utils';
|
||||
import {
|
||||
setRepo,
|
||||
setCommitAuthor,
|
||||
getCommitMessage,
|
||||
commit,
|
||||
push,
|
||||
pushTag
|
||||
} from './git-utils';
|
||||
import {getWorkDirName, addNoJekyll, addCNAME, skipOnFork} from './utils';
|
||||
|
||||
export async function run(): Promise<void> {
|
||||
@@ -54,11 +62,16 @@ export async function run(): Promise<void> {
|
||||
await exec.exec('git', ['remote', 'add', 'origin', remoteURL]);
|
||||
await exec.exec('git', ['add', '--all']);
|
||||
await setCommitAuthor(inps.UserName, inps.UserEmail);
|
||||
await commit(
|
||||
inps.AllowEmptyCommit,
|
||||
const hash = `${process.env.GITHUB_SHA}`;
|
||||
const baseRepo = `${github.context.repo.owner}/${github.context.repo.repo}`;
|
||||
const commitMessage = getCommitMessage(
|
||||
inps.CommitMessage,
|
||||
inps.FullCommitMessage,
|
||||
inps.ExternalRepository,
|
||||
inps.CommitMessage
|
||||
baseRepo,
|
||||
hash
|
||||
);
|
||||
await commit(inps.AllowEmptyCommit, commitMessage);
|
||||
await push(inps.PublishBranch, inps.ForceOrphan);
|
||||
await pushTag(inps.TagName, inps.TagMessage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user