mirror of
https://github.com/peaceiris/actions-hugo.git
synced 2026-01-25 20:32:19 +01:00
Compare commits
78 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb23a85c9f | ||
|
|
b30237c8ce | ||
|
|
4cd0877e87 | ||
|
|
b71ad2d014 | ||
|
|
e470a760d3 | ||
|
|
1649bea4d0 | ||
|
|
a2600d572b | ||
|
|
1bafab6d5a | ||
|
|
601b110315 | ||
|
|
c1f369064c | ||
|
|
8cd28fc857 | ||
|
|
702a3e4c9a | ||
|
|
d7620db17f | ||
|
|
64135da123 | ||
|
|
35eb187a3c | ||
|
|
c3a324ff3c | ||
|
|
9b11300647 | ||
|
|
6bed4121ee | ||
|
|
b9b88c049f | ||
|
|
da65b73f4d | ||
|
|
33d3f73fc7 | ||
|
|
a3f7ea4140 | ||
|
|
61937d118f | ||
|
|
88076695a9 | ||
|
|
2935a38e76 | ||
|
|
c69c549ff8 | ||
|
|
9cdeeef2f3 | ||
|
|
7c9a227529 | ||
|
|
514a588dc1 | ||
|
|
ea7a8f0343 | ||
|
|
de4f7b1136 | ||
|
|
0d2e11837b | ||
|
|
703c21fa41 | ||
|
|
844e33d410 | ||
|
|
3d71d2403d | ||
|
|
c6512d44a3 | ||
|
|
d17d5099d6 | ||
|
|
61f1757c8c | ||
|
|
f9fbf81b0c | ||
|
|
cc6e8832e8 | ||
|
|
0a1c87ea74 | ||
|
|
4ce8f62edb | ||
|
|
f48589d80e | ||
|
|
9026a94533 | ||
|
|
c430dcefd1 | ||
|
|
bc46e4063a | ||
|
|
6eb91d4870 | ||
|
|
df77f4d6bd | ||
|
|
bbb82a999a | ||
|
|
1972405991 | ||
|
|
ef069a5b5b | ||
|
|
cb4de30fad | ||
|
|
a8e5979167 | ||
|
|
5fcc41dbee | ||
|
|
bb9d9fa49a | ||
|
|
88ecc3f3da | ||
|
|
41b2600c91 | ||
|
|
4eed9e4759 | ||
|
|
81b5611b7c | ||
|
|
231e402918 | ||
|
|
4de9b09ee4 | ||
|
|
45ee73c48d | ||
|
|
75c9bc6dc7 | ||
|
|
f3bcf96547 | ||
|
|
2331ecd733 | ||
|
|
266cd0f351 | ||
|
|
4a12696aca | ||
|
|
07c50afccc | ||
|
|
9d826a479b | ||
|
|
d56d87baca | ||
|
|
6b6e84ed73 | ||
|
|
8095fcb0f4 | ||
|
|
f802d7f38d | ||
|
|
8850dd5d86 | ||
|
|
da0b7ac273 | ||
|
|
b9e10c3e30 | ||
|
|
38f8dc8ba8 | ||
|
|
0dd325e0bc |
@@ -2,7 +2,7 @@ version: 1
|
|||||||
update_configs:
|
update_configs:
|
||||||
- package_manager: "javascript"
|
- package_manager: "javascript"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
update_schedule: "daily"
|
update_schedule: "live"
|
||||||
default_labels:
|
default_labels:
|
||||||
- "dependencies"
|
- "dependencies"
|
||||||
commit_message:
|
commit_message:
|
||||||
|
|||||||
37
.github/workflows/dev-image.yml
vendored
Normal file
37
.github/workflows/dev-image.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: 'Dev Image CI'
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/dev-image.yml'
|
||||||
|
- '.dockerignore'
|
||||||
|
- '.nvmrc'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- 'Makefile'
|
||||||
|
pull_request:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/dev-image.yml'
|
||||||
|
- '.dockerignore'
|
||||||
|
- '.nvmrc'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- 'Makefile'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
skipci:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- run: echo "[skip ci] ${{ contains(github.event.head_commit.message, '[skip ci]') }}"
|
||||||
|
|
||||||
|
dev-image-test:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: make build
|
||||||
|
- run: make cirun cmd="npm ci"
|
||||||
|
- run: make ciall
|
||||||
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@@ -9,7 +9,6 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
@@ -19,8 +18,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Install github/hub
|
- name: Install github/hub
|
||||||
run: |
|
run: |
|
||||||
export HUB_VERSION="2.14.1"
|
export HUB_VERSION="2.14.2"
|
||||||
curl -fsSL https://github.com/github/hub/raw/40e421edd2c63d57bb8daa4bb9bbdfa21e8becf9/script/get | bash -s "${HUB_VERSION}"
|
curl -fsSL https://github.com/github/hub/raw/8d91904208171b013f9a9d1175f4ab39068db047/script/get | bash -s "${HUB_VERSION}"
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
env:
|
env:
|
||||||
|
|||||||
105
CHANGELOG.md
105
CHANGELOG.md
@@ -2,6 +2,111 @@
|
|||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
## [2.4.8](https://github.com/peaceiris/actions-hugo/compare/v2.4.7...v2.4.8) (2020-03-27)
|
||||||
|
|
||||||
|
|
||||||
|
### ci
|
||||||
|
|
||||||
|
* Add workflow for developing container (#231) ([b71ad2d](https://github.com/peaceiris/actions-hugo/commit/b71ad2d01404ec9d8cf12979cca37d47310e9aa7)), closes [#231](https://github.com/peaceiris/actions-hugo/issues/231)
|
||||||
|
* set update_schedule live ([61937d1](https://github.com/peaceiris/actions-hugo/commit/61937d118fd2de55dd288ee18edabb0e9f9d11e0))
|
||||||
|
|
||||||
|
### deps
|
||||||
|
|
||||||
|
* bump @types/node from 12.12.30 to 12.12.31 ([64135da](https://github.com/peaceiris/actions-hugo/commit/64135da123255189740dea81571630c0d8fcf7e7))
|
||||||
|
* bump @typescript-eslint/eslint-plugin from 2.23.0 to 2.24.0 ([2935a38](https://github.com/peaceiris/actions-hugo/commit/2935a38e763ed8cd23c43ba95236eeb811f659f9))
|
||||||
|
* bump @typescript-eslint/eslint-plugin from 2.24.0 to 2.25.0 ([b9b88c0](https://github.com/peaceiris/actions-hugo/commit/b9b88c049f68fdd1e11e50212923d07eb22967e1))
|
||||||
|
* bump @typescript-eslint/parser from 2.23.0 to 2.24.0 (#213) ([8807669](https://github.com/peaceiris/actions-hugo/commit/88076695a918ea1419ddeec9e16ba30e9faf4134)), closes [#213](https://github.com/peaceiris/actions-hugo/issues/213)
|
||||||
|
* bump @typescript-eslint/parser from 2.24.0 to 2.25.0 ([6bed412](https://github.com/peaceiris/actions-hugo/commit/6bed4121ee5d7bd8a3e22c856261b59b442f8193))
|
||||||
|
* bump @zeit/ncc from 0.21.1 to 0.22.0 ([c3a324f](https://github.com/peaceiris/actions-hugo/commit/c3a324ff3cf3e1b975c594d266ba4c7bd09daa19))
|
||||||
|
* bump jest from 25.1.0 to 25.2.0 ([d7620db](https://github.com/peaceiris/actions-hugo/commit/d7620db17f5b0b91867f71d01874a879651a727b))
|
||||||
|
* bump jest from 25.2.0 to 25.2.1 ([8cd28fc](https://github.com/peaceiris/actions-hugo/commit/8cd28fc857360a781d9ebd7103da74c17d4a2ce7))
|
||||||
|
* bump jest from 25.2.1 to 25.2.2 ([601b110](https://github.com/peaceiris/actions-hugo/commit/601b110315ada15bc46842682625b71a0be1902c))
|
||||||
|
* bump jest from 25.2.2 to 25.2.3 ([1649bea](https://github.com/peaceiris/actions-hugo/commit/1649bea4d0a67e4b6af6ed2b95fea1e66673239b))
|
||||||
|
* bump jest-circus from 25.1.0 to 25.2.0 ([702a3e4](https://github.com/peaceiris/actions-hugo/commit/702a3e4c9ae5cf3ce9e380e45504d2b28e0dcc46))
|
||||||
|
* bump jest-circus from 25.2.0 to 25.2.1 ([c1f3690](https://github.com/peaceiris/actions-hugo/commit/c1f369064cf05c10277655226e2a4723266d7161))
|
||||||
|
* bump jest-circus from 25.2.1 to 25.2.2 ([1bafab6](https://github.com/peaceiris/actions-hugo/commit/1bafab6d5aa5d524d86e28cf6bcb8c41a09cc51d))
|
||||||
|
* bump jest-circus from 25.2.2 to 25.2.3 ([a2600d5](https://github.com/peaceiris/actions-hugo/commit/a2600d572b522fb75cd38aba6b6306501618579d))
|
||||||
|
* bump lint-staged from 10.0.8 to 10.0.9 ([35eb187](https://github.com/peaceiris/actions-hugo/commit/35eb187a3cd1e2b3370f881bfc97396d483585f8))
|
||||||
|
* bump nock from 12.0.2 to 12.0.3 ([a3f7ea4](https://github.com/peaceiris/actions-hugo/commit/a3f7ea4140f3f85196f7ea5d76bd2eeb5524a646))
|
||||||
|
* bump prettier from 1.19.1 to 2.0.1 ([da65b73](https://github.com/peaceiris/actions-hugo/commit/da65b73f4d4d3f23a392b882cb81c6538dda23b0))
|
||||||
|
* bump prettier from 2.0.1 to 2.0.2 ([9b11300](https://github.com/peaceiris/actions-hugo/commit/9b11300647ddf5ce6c42733e335be78e5ae855b6))
|
||||||
|
* node from 12.15.0 to 12.16.1 (#232) ([e470a76](https://github.com/peaceiris/actions-hugo/commit/e470a760d3eda16dddba7bcf4c66a3ae371c61f2)), closes [#232](https://github.com/peaceiris/actions-hugo/issues/232)
|
||||||
|
|
||||||
|
### docs
|
||||||
|
|
||||||
|
* Add codeclimate badge ([c69c549](https://github.com/peaceiris/actions-hugo/commit/c69c549ff8c5106c435657fba74f76cb807db1ec))
|
||||||
|
* bump actions/checkout to v2 ([33d3f73](https://github.com/peaceiris/actions-hugo/commit/33d3f73fc7bb54a2fe21cdeee8e93881c3094b92))
|
||||||
|
* update notes ([4cd0877](https://github.com/peaceiris/actions-hugo/commit/4cd0877e8793c755e53b341fa5fe43801f9319a2))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.4.7](https://github.com/peaceiris/actions-hugo/compare/v2.4.6...v2.4.7) (2020-03-13)
|
||||||
|
|
||||||
|
|
||||||
|
### ci
|
||||||
|
|
||||||
|
* update script link [skip ci] ([3d71d24](https://github.com/peaceiris/actions-hugo/commit/3d71d2403d36fe0c2770d1a69526ca5d8ba884c5))
|
||||||
|
|
||||||
|
### deps
|
||||||
|
|
||||||
|
* [security] bump acorn from 6.4.0 to 6.4.1 ([ea7a8f0](https://github.com/peaceiris/actions-hugo/commit/ea7a8f03436f5eefe2b0509210f62bb60eb645ce))
|
||||||
|
* bump @actions/core from 1.2.2 to 1.2.3 ([cc6e883](https://github.com/peaceiris/actions-hugo/commit/cc6e8832e8df3d38ea15016148e7499d67595412))
|
||||||
|
* bump @actions/tool-cache from 1.3.1 to 1.3.2 ([c6512d4](https://github.com/peaceiris/actions-hugo/commit/c6512d44a3620fbc3158c62e47d6a3e1a8a0696d))
|
||||||
|
* bump @actions/tool-cache from 1.3.2 to 1.3.3 ([0d2e118](https://github.com/peaceiris/actions-hugo/commit/0d2e11837b439e036687b3766548fe67efe14e04))
|
||||||
|
* bump @types/jest from 25.1.3 to 25.1.4 ([d17d509](https://github.com/peaceiris/actions-hugo/commit/d17d5099d67ed8aca0af28f612ffa36a2751b013))
|
||||||
|
* bump @types/node from 12.12.28 to 12.12.29 ([bc46e40](https://github.com/peaceiris/actions-hugo/commit/bc46e4063a096f87cc0faaf107b160c4686b9462))
|
||||||
|
* bump @types/node from 12.12.29 to 12.12.30 ([de4f7b1](https://github.com/peaceiris/actions-hugo/commit/de4f7b11367e07ace82f9ada91775cfbb03b88da))
|
||||||
|
* bump @typescript-eslint/eslint-plugin from 2.21.0 to 2.22.0 ([4ce8f62](https://github.com/peaceiris/actions-hugo/commit/4ce8f62edb9e86b50989996e17b6a8ed20b30a4b))
|
||||||
|
* bump @typescript-eslint/eslint-plugin from 2.22.0 to 2.23.0 ([844e33d](https://github.com/peaceiris/actions-hugo/commit/844e33d4107bfb7ab1cc21f6a4fab8b51bf441b1))
|
||||||
|
* bump @typescript-eslint/parser from 2.21.0 to 2.22.0 ([0a1c87e](https://github.com/peaceiris/actions-hugo/commit/0a1c87ea74e0cdf3a147e464f7814576f07a46bf))
|
||||||
|
* bump @typescript-eslint/parser from 2.22.0 to 2.23.0 ([703c21f](https://github.com/peaceiris/actions-hugo/commit/703c21fa41ab2b6f1c71a6bdbc4f795eff75abea))
|
||||||
|
* bump eslint-plugin-jest from 23.8.0 to 23.8.1 (#198) ([f48589d](https://github.com/peaceiris/actions-hugo/commit/f48589d80e2cf825cef0479d547f2767a2bf9414)), closes [#198](https://github.com/peaceiris/actions-hugo/issues/198)
|
||||||
|
* bump eslint-plugin-jest from 23.8.1 to 23.8.2 ([f9fbf81](https://github.com/peaceiris/actions-hugo/commit/f9fbf81b0c07b5293e596585fc22b49e40d818ec))
|
||||||
|
* bump hub 2.14.1 to 2.14.2 ([61f1757](https://github.com/peaceiris/actions-hugo/commit/61f1757c8c728f8fd8e8e96f56b81171e007ef28))
|
||||||
|
* bump nock from 12.0.1 to 12.0.2 ([c430dce](https://github.com/peaceiris/actions-hugo/commit/c430dcefd1e96d100f28c2a8e5b5084a84fe2c0d))
|
||||||
|
* bump typescript from 3.8.2 to 3.8.3 ([9026a94](https://github.com/peaceiris/actions-hugo/commit/9026a9453330ef8189b318c2339c250ea05c5947))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.4.6](https://github.com/peaceiris/actions-hugo/compare/v2.4.5...v2.4.6) (2020-02-26)
|
||||||
|
|
||||||
|
|
||||||
|
### deps
|
||||||
|
|
||||||
|
* bump @types/jest from 25.1.1 to 25.1.2 ([da0b7ac](https://github.com/peaceiris/actions-hugo/commit/da0b7ac273fb7fc345e8a98c58e620b7f85df2f5))
|
||||||
|
* bump @types/jest from 25.1.2 to 25.1.3 ([45ee73c](https://github.com/peaceiris/actions-hugo/commit/45ee73c48da3bd070b8e8a1f9bfed354e6e50c82))
|
||||||
|
* bump @types/node from 12.12.27 to 12.12.28 ([4eed9e4](https://github.com/peaceiris/actions-hugo/commit/4eed9e47590cb859dcc19bd396d1360b45813dda))
|
||||||
|
* bump @types/node from 13.7.0 to 13.7.1 ([9d826a4](https://github.com/peaceiris/actions-hugo/commit/9d826a479b558de962af26211fc1a3e2ae6d7b92))
|
||||||
|
* bump @types/node from 13.7.1 to 13.7.2 ([f3bcf96](https://github.com/peaceiris/actions-hugo/commit/f3bcf965479d21716fcdb4c6b459562b13892a4a))
|
||||||
|
* bump @types/node-fetch from 2.5.4 to 2.5.5 ([a8e5979](https://github.com/peaceiris/actions-hugo/commit/a8e5979167c907a9253458eb96b7b3281f055722))
|
||||||
|
* bump @typescript-eslint/eslint-plugin from 2.19.0 to 2.19.2 ([d56d87b](https://github.com/peaceiris/actions-hugo/commit/d56d87baca65a2ba667e218745e6409fc8ad6fcf))
|
||||||
|
* bump @typescript-eslint/eslint-plugin from 2.19.2 to 2.20.0 ([266cd0f](https://github.com/peaceiris/actions-hugo/commit/266cd0f3511e7ae5949d408a7374f7cf418420cd))
|
||||||
|
* bump @typescript-eslint/eslint-plugin from 2.20.0 to 2.21.0 ([5fcc41d](https://github.com/peaceiris/actions-hugo/commit/5fcc41dbee64328185c1450e01b5ec5c7bb7e7e8))
|
||||||
|
* bump @typescript-eslint/parser from 2.19.0 to 2.19.2 ([6b6e84e](https://github.com/peaceiris/actions-hugo/commit/6b6e84ed73751418f2c94fe50e135960082c51af))
|
||||||
|
* bump @typescript-eslint/parser from 2.19.2 to 2.20.0 ([2331ecd](https://github.com/peaceiris/actions-hugo/commit/2331ecd7332e9b1d816565a6faecf4b1f0e3f0d2))
|
||||||
|
* bump @typescript-eslint/parser from 2.20.0 to 2.21.0 ([bb9d9fa](https://github.com/peaceiris/actions-hugo/commit/bb9d9fa49a8dde93d1121211f8fe140c6f85794d))
|
||||||
|
* bump @zeit/ncc from 0.21.0 to 0.21.1 ([ef069a5](https://github.com/peaceiris/actions-hugo/commit/ef069a5b5b3305eebd68c97222f27a4b7eff8187))
|
||||||
|
* bump eslint-plugin-jest from 23.6.0 to 23.7.0 ([f802d7f](https://github.com/peaceiris/actions-hugo/commit/f802d7f38d757aa9d19596ede8783cc21687fc0d))
|
||||||
|
* bump eslint-plugin-jest from 23.7.0 to 23.8.0 ([cb4de30](https://github.com/peaceiris/actions-hugo/commit/cb4de30fad3d0414055024a3a0d460b1e8ec39ec))
|
||||||
|
* bump husky from 4.2.1 to 4.2.3 ([07c50af](https://github.com/peaceiris/actions-hugo/commit/07c50afccc821b24526b6c6257f65ba17a4bb727))
|
||||||
|
* bump lint-staged from 10.0.7 to 10.0.8 ([1972405](https://github.com/peaceiris/actions-hugo/commit/1972405991185de2af9d20fcf69786268e52039c))
|
||||||
|
* bump nock from 11.7.2 to 11.8.2 ([8095fcb](https://github.com/peaceiris/actions-hugo/commit/8095fcb0f41d1541ef1d84e019cb67f9e9595e85))
|
||||||
|
* bump nock from 11.8.2 to 12.0.0 ([4a12696](https://github.com/peaceiris/actions-hugo/commit/4a12696aca76ef260d0b7a55d1290c2b778ddfdb))
|
||||||
|
* bump nock from 12.0.0 to 12.0.1 ([231e402](https://github.com/peaceiris/actions-hugo/commit/231e4029187d257cc58b840ed341257b4b20e288))
|
||||||
|
* bump node from 12.14.1 to 12.15.0 (#172) ([8850dd5](https://github.com/peaceiris/actions-hugo/commit/8850dd5d86b98f7f80c761547cd73ce9df779127)), closes [#172](https://github.com/peaceiris/actions-hugo/issues/172)
|
||||||
|
* bump ts-jest from 25.2.0 to 25.2.1 ([4de9b09](https://github.com/peaceiris/actions-hugo/commit/4de9b09ee49dc89ca2d9a914f99020b6392580eb))
|
||||||
|
* bump typescript from 3.7.5 to 3.8.2 ([81b5611](https://github.com/peaceiris/actions-hugo/commit/81b5611b7c835dabe63ae1700be5719f276debf4))
|
||||||
|
* Rollback types/node 13 to 12 (#185) ([75c9bc6](https://github.com/peaceiris/actions-hugo/commit/75c9bc6dc7f95893877154254cd001d8b5ebe76a)), closes [#185](https://github.com/peaceiris/actions-hugo/issues/185)
|
||||||
|
|
||||||
|
### docs
|
||||||
|
|
||||||
|
* Add note about actions/checkout@v2 ([b9e10c3](https://github.com/peaceiris/actions-hugo/commit/b9e10c3e30353f050fbad487660f9dd198c32662))
|
||||||
|
* update ([88ecc3f](https://github.com/peaceiris/actions-hugo/commit/88ecc3f3da2d10d3aa78000a27da4490493e81cb))
|
||||||
|
* use github_token ([41b2600](https://github.com/peaceiris/actions-hugo/commit/41b2600c915a0e5a3e0b2fc0fa178e65e311152a))
|
||||||
|
* use peaceiris/actions-gh-pages@v3 ([38f8dc8](https://github.com/peaceiris/actions-hugo/commit/38f8dc8ba89e5b6143d0c921b049481c011aa0a7))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [2.4.5](https://github.com/peaceiris/actions-hugo/compare/v2.4.4...v2.4.5) (2020-02-04)
|
## [2.4.5](https://github.com/peaceiris/actions-hugo/compare/v2.4.4...v2.4.5) (2020-02-04)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ RUN apt-get update && \
|
|||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /git
|
WORKDIR /git
|
||||||
ENV GIT_VERSION="2.25.0"
|
ENV GIT_VERSION="2.26.0"
|
||||||
RUN wget -q "https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz" && \
|
RUN wget -q "https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz" && \
|
||||||
tar -zxf "./v${GIT_VERSION}.tar.gz" && \
|
tar -zxf "./v${GIT_VERSION}.tar.gz" && \
|
||||||
rm "./v${GIT_VERSION}.tar.gz" && \
|
rm "./v${GIT_VERSION}.tar.gz" && \
|
||||||
@@ -24,5 +24,6 @@ RUN wget -q "https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz" && \
|
|||||||
make install
|
make install
|
||||||
|
|
||||||
WORKDIR /repo
|
WORKDIR /repo
|
||||||
|
ENV RUNNER_TEMP="/tmp"
|
||||||
|
|
||||||
CMD [ "bash" ]
|
CMD [ "bash" ]
|
||||||
|
|||||||
15
Makefile
15
Makefile
@@ -4,6 +4,7 @@ IMAGE_NAME := actions_hugo_dev:latest
|
|||||||
NODE_VERSION := $(shell cat ./.nvmrc)
|
NODE_VERSION := $(shell cat ./.nvmrc)
|
||||||
DOCKER_BUILD := docker build . -t $(IMAGE_NAME) --build-arg NODE_VERSION=$(NODE_VERSION)
|
DOCKER_BUILD := docker build . -t $(IMAGE_NAME) --build-arg NODE_VERSION=$(NODE_VERSION)
|
||||||
DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/root/.gitconfig $(IMAGE_NAME)
|
DOCKER_RUN := docker run --rm -i -t -v ${PWD}:/repo -v ~/.gitconfig:/root/.gitconfig $(IMAGE_NAME)
|
||||||
|
DOCKER_RUN_CI := docker run --rm -v ${PWD}:/repo $(IMAGE_NAME)
|
||||||
|
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
@@ -14,10 +15,18 @@ build:
|
|||||||
run:
|
run:
|
||||||
$(DOCKER_RUN) $(cmd)
|
$(DOCKER_RUN) $(cmd)
|
||||||
|
|
||||||
|
.PHONY: cirun
|
||||||
|
cirun:
|
||||||
|
$(DOCKER_RUN_CI) $(cmd)
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
$(DOCKER_RUN) npm test
|
$(DOCKER_RUN) npm test
|
||||||
|
|
||||||
.PHONY: commit
|
.PHONY: all
|
||||||
commit:
|
all:
|
||||||
$(DOCKER_RUN) git commit -m "$(msg)"
|
$(DOCKER_RUN) npm run all
|
||||||
|
|
||||||
|
.PHONY: ciall
|
||||||
|
ciall:
|
||||||
|
$(DOCKER_RUN_CI) npm run all
|
||||||
|
|||||||
36
README.md
36
README.md
@@ -1,11 +1,13 @@
|
|||||||
[](https://github.com/peaceiris/actions-hugo/blob/master/LICENSE)
|
[](https://github.com/peaceiris/actions-hugo/blob/master/LICENSE)
|
||||||
[](https://github.com/peaceiris/actions-hugo/releases/latest)
|
[](https://github.com/peaceiris/actions-hugo/releases/latest)
|
||||||
[](https://github.com/peaceiris/actions-hugo/releases)
|
[](https://github.com/peaceiris/actions-hugo/releases)
|
||||||
|
[](https://github.com/peaceiris/actions-hugo/releases.atom)
|
||||||

|

|
||||||
|
[](https://dependabot.com)
|
||||||
|
|
||||||
[](https://www.codefactor.io/repository/github/peaceiris/actions-hugo)
|
[](https://www.codefactor.io/repository/github/peaceiris/actions-hugo)
|
||||||
[](https://codecov.io/gh/peaceiris/actions-hugo)
|
[](https://codecov.io/gh/peaceiris/actions-hugo)
|
||||||
[](https://github.com/peaceiris/actions-hugo/releases.atom)
|
[](https://codeclimate.com/github/peaceiris/actions-hugo/maintainability)
|
||||||
[](https://dependabot.com)
|
|
||||||
|
|
||||||
<img width="400" alt="GitHub Actions for Hugo" src="./images/ogp.svg">
|
<img width="400" alt="GitHub Actions for Hugo" src="./images/ogp.svg">
|
||||||
|
|
||||||
@@ -77,12 +79,12 @@ on:
|
|||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-deploy:
|
deploy:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
# with:
|
with:
|
||||||
# submodules: true
|
submodules: true
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup Hugo
|
||||||
uses: peaceiris/actions-hugo@v2
|
uses: peaceiris/actions-hugo@v2
|
||||||
@@ -94,11 +96,10 @@ jobs:
|
|||||||
run: hugo --minify
|
run: hugo --minify
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v2
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
env:
|
with:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
PUBLISH_BRANCH: gh-pages
|
publish_dir: ./public
|
||||||
PUBLISH_DIR: ./public
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<div align="right">
|
<div align="right">
|
||||||
@@ -220,19 +221,14 @@ The alpine base Hugo Docker image is provided on the following repository.
|
|||||||
|
|
||||||
## Maintainer Notes
|
## Maintainer Notes
|
||||||
|
|
||||||
Run `npm` and `git commit` commands on a container.
|
Run `npm test` on a Docker container.
|
||||||
|
|
||||||
**On Host**
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Docker
|
# On container
|
||||||
make build
|
make build
|
||||||
make run
|
make all
|
||||||
make run cmd="env"
|
|
||||||
make test
|
|
||||||
make commit msg="chore: Add Makefile"
|
|
||||||
|
|
||||||
# Release
|
# Release script on host
|
||||||
./release.sh
|
./release.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
343
lib/index.js
343
lib/index.js
@@ -942,9 +942,9 @@ module.exports = require("tls");
|
|||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 18:
|
/***/ 18:
|
||||||
/***/ (function() {
|
/***/ (function(module) {
|
||||||
|
|
||||||
eval("require")("encoding");
|
module.exports = eval("require")("encoding");
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@@ -3296,6 +3296,13 @@ exports.setFailed = setFailed;
|
|||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Logging Commands
|
// Logging Commands
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Gets whether Actions Step Debug is on or not
|
||||||
|
*/
|
||||||
|
function isDebug() {
|
||||||
|
return process.env['RUNNER_DEBUG'] === '1';
|
||||||
|
}
|
||||||
|
exports.isDebug = isDebug;
|
||||||
/**
|
/**
|
||||||
* Writes debug message to user log
|
* Writes debug message to user log
|
||||||
* @param message debug message
|
* @param message debug message
|
||||||
@@ -3427,9 +3434,12 @@ const os = __importStar(__webpack_require__(87));
|
|||||||
const path = __importStar(__webpack_require__(622));
|
const path = __importStar(__webpack_require__(622));
|
||||||
const httpm = __importStar(__webpack_require__(539));
|
const httpm = __importStar(__webpack_require__(539));
|
||||||
const semver = __importStar(__webpack_require__(550));
|
const semver = __importStar(__webpack_require__(550));
|
||||||
|
const stream = __importStar(__webpack_require__(413));
|
||||||
|
const util = __importStar(__webpack_require__(669));
|
||||||
const v4_1 = __importDefault(__webpack_require__(826));
|
const v4_1 = __importDefault(__webpack_require__(826));
|
||||||
const exec_1 = __webpack_require__(986);
|
const exec_1 = __webpack_require__(986);
|
||||||
const assert_1 = __webpack_require__(357);
|
const assert_1 = __webpack_require__(357);
|
||||||
|
const retry_helper_1 = __webpack_require__(979);
|
||||||
class HTTPError extends Error {
|
class HTTPError extends Error {
|
||||||
constructor(httpStatusCode) {
|
constructor(httpStatusCode) {
|
||||||
super(`Unexpected HTTP response: ${httpStatusCode}`);
|
super(`Unexpected HTTP response: ${httpStatusCode}`);
|
||||||
@@ -3440,31 +3450,6 @@ class HTTPError extends Error {
|
|||||||
exports.HTTPError = HTTPError;
|
exports.HTTPError = HTTPError;
|
||||||
const IS_WINDOWS = process.platform === 'win32';
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
const userAgent = 'actions/tool-cache';
|
const userAgent = 'actions/tool-cache';
|
||||||
// On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
|
|
||||||
let tempDirectory = process.env['RUNNER_TEMP'] || '';
|
|
||||||
let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
|
|
||||||
// If directories not found, place them in common temp locations
|
|
||||||
if (!tempDirectory || !cacheRoot) {
|
|
||||||
let baseLocation;
|
|
||||||
if (IS_WINDOWS) {
|
|
||||||
// On windows use the USERPROFILE env variable
|
|
||||||
baseLocation = process.env['USERPROFILE'] || 'C:\\';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (process.platform === 'darwin') {
|
|
||||||
baseLocation = '/Users';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
baseLocation = '/home';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!tempDirectory) {
|
|
||||||
tempDirectory = path.join(baseLocation, 'actions', 'temp');
|
|
||||||
}
|
|
||||||
if (!cacheRoot) {
|
|
||||||
cacheRoot = path.join(baseLocation, 'actions', 'cache');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Download a tool from an url and stream it into a file
|
* Download a tool from an url and stream it into a file
|
||||||
*
|
*
|
||||||
@@ -3474,52 +3459,71 @@ if (!tempDirectory || !cacheRoot) {
|
|||||||
*/
|
*/
|
||||||
function downloadTool(url, dest) {
|
function downloadTool(url, dest) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// Wrap in a promise so that we can resolve from within stream callbacks
|
dest = dest || path.join(_getTempDirectory(), v4_1.default());
|
||||||
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
try {
|
|
||||||
const http = new httpm.HttpClient(userAgent, [], {
|
|
||||||
allowRetries: true,
|
|
||||||
maxRetries: 3
|
|
||||||
});
|
|
||||||
dest = dest || path.join(tempDirectory, v4_1.default());
|
|
||||||
yield io.mkdirP(path.dirname(dest));
|
yield io.mkdirP(path.dirname(dest));
|
||||||
core.debug(`Downloading ${url}`);
|
core.debug(`Downloading ${url}`);
|
||||||
core.debug(`Downloading ${dest}`);
|
core.debug(`Destination ${dest}`);
|
||||||
|
const maxAttempts = 3;
|
||||||
|
const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
|
||||||
|
const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
|
||||||
|
const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
|
||||||
|
return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return yield downloadToolAttempt(url, dest || '');
|
||||||
|
}), (err) => {
|
||||||
|
if (err instanceof HTTPError && err.httpStatusCode) {
|
||||||
|
// Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
|
||||||
|
if (err.httpStatusCode < 500 &&
|
||||||
|
err.httpStatusCode !== 408 &&
|
||||||
|
err.httpStatusCode !== 429) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Otherwise retry
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.downloadTool = downloadTool;
|
||||||
|
function downloadToolAttempt(url, dest) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (fs.existsSync(dest)) {
|
if (fs.existsSync(dest)) {
|
||||||
throw new Error(`Destination file path ${dest} already exists`);
|
throw new Error(`Destination file path ${dest} already exists`);
|
||||||
}
|
}
|
||||||
|
// Get the response headers
|
||||||
|
const http = new httpm.HttpClient(userAgent, [], {
|
||||||
|
allowRetries: false
|
||||||
|
});
|
||||||
const response = yield http.get(url);
|
const response = yield http.get(url);
|
||||||
if (response.message.statusCode !== 200) {
|
if (response.message.statusCode !== 200) {
|
||||||
const err = new HTTPError(response.message.statusCode);
|
const err = new HTTPError(response.message.statusCode);
|
||||||
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
const file = fs.createWriteStream(dest);
|
// Download the response body
|
||||||
file.on('open', () => __awaiter(this, void 0, void 0, function* () {
|
const pipeline = util.promisify(stream.pipeline);
|
||||||
|
const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
|
||||||
|
const readStream = responseMessageFactory();
|
||||||
|
let succeeded = false;
|
||||||
try {
|
try {
|
||||||
const stream = response.message.pipe(file);
|
yield pipeline(readStream, fs.createWriteStream(dest));
|
||||||
stream.on('close', () => {
|
|
||||||
core.debug('download complete');
|
core.debug('download complete');
|
||||||
resolve(dest);
|
succeeded = true;
|
||||||
});
|
return dest;
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// Error, delete dest before retry
|
||||||
|
if (!succeeded) {
|
||||||
|
core.debug('download failed');
|
||||||
|
try {
|
||||||
|
yield io.rmRF(dest);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
core.debug(`Failed to delete '${dest}'. ${err.message}`);
|
||||||
reject(err);
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}));
|
|
||||||
file.on('error', err => {
|
|
||||||
file.end();
|
|
||||||
reject(err);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (err) {
|
|
||||||
reject(err);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
exports.downloadTool = downloadTool;
|
|
||||||
/**
|
/**
|
||||||
* Extract a .7z file
|
* Extract a .7z file
|
||||||
*
|
*
|
||||||
@@ -3609,14 +3613,17 @@ function extractTar(file, dest, flags = 'xz') {
|
|||||||
// Create dest
|
// Create dest
|
||||||
dest = yield _createExtractFolder(dest);
|
dest = yield _createExtractFolder(dest);
|
||||||
// Determine whether GNU tar
|
// Determine whether GNU tar
|
||||||
|
core.debug('Checking tar --version');
|
||||||
let versionOutput = '';
|
let versionOutput = '';
|
||||||
yield exec_1.exec('tar --version', [], {
|
yield exec_1.exec('tar --version', [], {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
|
silent: true,
|
||||||
listeners: {
|
listeners: {
|
||||||
stdout: (data) => (versionOutput += data.toString()),
|
stdout: (data) => (versionOutput += data.toString()),
|
||||||
stderr: (data) => (versionOutput += data.toString())
|
stderr: (data) => (versionOutput += data.toString())
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
core.debug(versionOutput.trim());
|
||||||
const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
|
const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
|
||||||
// Initialize args
|
// Initialize args
|
||||||
const args = [flags];
|
const args = [flags];
|
||||||
@@ -3777,7 +3784,7 @@ function find(toolName, versionSpec, arch) {
|
|||||||
let toolPath = '';
|
let toolPath = '';
|
||||||
if (versionSpec) {
|
if (versionSpec) {
|
||||||
versionSpec = semver.clean(versionSpec) || '';
|
versionSpec = semver.clean(versionSpec) || '';
|
||||||
const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
|
const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
|
||||||
core.debug(`checking cache: ${cachePath}`);
|
core.debug(`checking cache: ${cachePath}`);
|
||||||
if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
|
if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
|
||||||
core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
|
core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
|
||||||
@@ -3799,7 +3806,7 @@ exports.find = find;
|
|||||||
function findAllVersions(toolName, arch) {
|
function findAllVersions(toolName, arch) {
|
||||||
const versions = [];
|
const versions = [];
|
||||||
arch = arch || os.arch();
|
arch = arch || os.arch();
|
||||||
const toolPath = path.join(cacheRoot, toolName);
|
const toolPath = path.join(_getCacheDirectory(), toolName);
|
||||||
if (fs.existsSync(toolPath)) {
|
if (fs.existsSync(toolPath)) {
|
||||||
const children = fs.readdirSync(toolPath);
|
const children = fs.readdirSync(toolPath);
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
@@ -3818,7 +3825,7 @@ function _createExtractFolder(dest) {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (!dest) {
|
if (!dest) {
|
||||||
// create a temp dir
|
// create a temp dir
|
||||||
dest = path.join(tempDirectory, v4_1.default());
|
dest = path.join(_getTempDirectory(), v4_1.default());
|
||||||
}
|
}
|
||||||
yield io.mkdirP(dest);
|
yield io.mkdirP(dest);
|
||||||
return dest;
|
return dest;
|
||||||
@@ -3826,7 +3833,7 @@ function _createExtractFolder(dest) {
|
|||||||
}
|
}
|
||||||
function _createToolPath(tool, version, arch) {
|
function _createToolPath(tool, version, arch) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
|
const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
|
||||||
core.debug(`destination ${folderPath}`);
|
core.debug(`destination ${folderPath}`);
|
||||||
const markerPath = `${folderPath}.complete`;
|
const markerPath = `${folderPath}.complete`;
|
||||||
yield io.rmRF(folderPath);
|
yield io.rmRF(folderPath);
|
||||||
@@ -3836,7 +3843,7 @@ function _createToolPath(tool, version, arch) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function _completeToolPath(tool, version, arch) {
|
function _completeToolPath(tool, version, arch) {
|
||||||
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
|
const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
|
||||||
const markerPath = `${folderPath}.complete`;
|
const markerPath = `${folderPath}.complete`;
|
||||||
fs.writeFileSync(markerPath, '');
|
fs.writeFileSync(markerPath, '');
|
||||||
core.debug('finished caching tool');
|
core.debug('finished caching tool');
|
||||||
@@ -3873,6 +3880,31 @@ function _evaluateVersions(versions, versionSpec) {
|
|||||||
}
|
}
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Gets RUNNER_TOOL_CACHE
|
||||||
|
*/
|
||||||
|
function _getCacheDirectory() {
|
||||||
|
const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
|
||||||
|
assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
|
||||||
|
return cacheDirectory;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets RUNNER_TEMP
|
||||||
|
*/
|
||||||
|
function _getTempDirectory() {
|
||||||
|
const tempDirectory = process.env['RUNNER_TEMP'] || '';
|
||||||
|
assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
|
||||||
|
return tempDirectory;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets a global variable
|
||||||
|
*/
|
||||||
|
function _getGlobal(key, defaultValue) {
|
||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
const value = global[key];
|
||||||
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
||||||
|
return value !== undefined ? value : defaultValue;
|
||||||
|
}
|
||||||
//# sourceMappingURL=tool-cache.js.map
|
//# sourceMappingURL=tool-cache.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
@@ -3917,6 +3949,15 @@ var HttpCodes;
|
|||||||
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
||||||
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
|
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
|
||||||
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
|
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
|
||||||
|
var Headers;
|
||||||
|
(function (Headers) {
|
||||||
|
Headers["Accept"] = "accept";
|
||||||
|
Headers["ContentType"] = "content-type";
|
||||||
|
})(Headers = exports.Headers || (exports.Headers = {}));
|
||||||
|
var MediaTypes;
|
||||||
|
(function (MediaTypes) {
|
||||||
|
MediaTypes["ApplicationJson"] = "application/json";
|
||||||
|
})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
|
||||||
/**
|
/**
|
||||||
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
||||||
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
@@ -4015,6 +4056,36 @@ class HttpClient {
|
|||||||
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
||||||
return this.request(verb, requestUrl, stream, additionalHeaders);
|
return this.request(verb, requestUrl, stream, additionalHeaders);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Gets a typed object from an endpoint
|
||||||
|
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
||||||
|
*/
|
||||||
|
async getJson(requestUrl, additionalHeaders = {}) {
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
let res = await this.get(requestUrl, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
}
|
||||||
|
async postJson(requestUrl, obj, additionalHeaders = {}) {
|
||||||
|
let data = JSON.stringify(obj, null, 2);
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
||||||
|
let res = await this.post(requestUrl, data, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
}
|
||||||
|
async putJson(requestUrl, obj, additionalHeaders = {}) {
|
||||||
|
let data = JSON.stringify(obj, null, 2);
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
||||||
|
let res = await this.put(requestUrl, data, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
}
|
||||||
|
async patchJson(requestUrl, obj, additionalHeaders = {}) {
|
||||||
|
let data = JSON.stringify(obj, null, 2);
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
||||||
|
let res = await this.patch(requestUrl, data, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Makes a raw http request.
|
* Makes a raw http request.
|
||||||
* All other methods such as get, post, patch, and request ultimately call this.
|
* All other methods such as get, post, patch, and request ultimately call this.
|
||||||
@@ -4198,6 +4269,14 @@ class HttpClient {
|
|||||||
}
|
}
|
||||||
return lowercaseKeys(headers || {});
|
return lowercaseKeys(headers || {});
|
||||||
}
|
}
|
||||||
|
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
|
||||||
|
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
|
||||||
|
let clientHeader;
|
||||||
|
if (this.requestOptions && this.requestOptions.headers) {
|
||||||
|
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
|
||||||
|
}
|
||||||
|
return additionalHeaders[header] || clientHeader || _default;
|
||||||
|
}
|
||||||
_getAgent(parsedUrl) {
|
_getAgent(parsedUrl) {
|
||||||
let agent;
|
let agent;
|
||||||
let proxyUrl = pm.getProxyUrl(parsedUrl);
|
let proxyUrl = pm.getProxyUrl(parsedUrl);
|
||||||
@@ -4265,6 +4344,73 @@ class HttpClient {
|
|||||||
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
||||||
return new Promise(resolve => setTimeout(() => resolve(), ms));
|
return new Promise(resolve => setTimeout(() => resolve(), ms));
|
||||||
}
|
}
|
||||||
|
static dateTimeDeserializer(key, value) {
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
let a = new Date(value);
|
||||||
|
if (!isNaN(a.valueOf())) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
async _processResponse(res, options) {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
const statusCode = res.message.statusCode;
|
||||||
|
const response = {
|
||||||
|
statusCode: statusCode,
|
||||||
|
result: null,
|
||||||
|
headers: {}
|
||||||
|
};
|
||||||
|
// not found leads to null obj returned
|
||||||
|
if (statusCode == HttpCodes.NotFound) {
|
||||||
|
resolve(response);
|
||||||
|
}
|
||||||
|
let obj;
|
||||||
|
let contents;
|
||||||
|
// get the result from the body
|
||||||
|
try {
|
||||||
|
contents = await res.readBody();
|
||||||
|
if (contents && contents.length > 0) {
|
||||||
|
if (options && options.deserializeDates) {
|
||||||
|
obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj = JSON.parse(contents);
|
||||||
|
}
|
||||||
|
response.result = obj;
|
||||||
|
}
|
||||||
|
response.headers = res.message.headers;
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// Invalid resource (contents not json); leaving result obj null
|
||||||
|
}
|
||||||
|
// note that 3xx redirects are handled by the http layer.
|
||||||
|
if (statusCode > 299) {
|
||||||
|
let msg;
|
||||||
|
// if exception/error in body, attempt to get better error
|
||||||
|
if (obj && obj.message) {
|
||||||
|
msg = obj.message;
|
||||||
|
}
|
||||||
|
else if (contents && contents.length > 0) {
|
||||||
|
// it may be the case that the exception is in the body message as string
|
||||||
|
msg = contents;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg = "Failed request: (" + statusCode + ")";
|
||||||
|
}
|
||||||
|
let err = new Error(msg);
|
||||||
|
// attach statusCode and body obj (if available) to the error object
|
||||||
|
err['statusCode'] = statusCode;
|
||||||
|
if (response.result) {
|
||||||
|
err['result'] = response.result;
|
||||||
|
}
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(response);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.HttpClient = HttpClient;
|
exports.HttpClient = HttpClient;
|
||||||
|
|
||||||
@@ -6429,6 +6575,83 @@ function checkBypass(reqUrl) {
|
|||||||
exports.checkBypass = checkBypass;
|
exports.checkBypass = checkBypass;
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 979:
|
||||||
|
/***/ (function(__unusedmodule, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
return new (P || (P = Promise))(function (resolve, reject) {
|
||||||
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||||
|
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||||
|
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const core = __importStar(__webpack_require__(470));
|
||||||
|
/**
|
||||||
|
* Internal class for retries
|
||||||
|
*/
|
||||||
|
class RetryHelper {
|
||||||
|
constructor(maxAttempts, minSeconds, maxSeconds) {
|
||||||
|
if (maxAttempts < 1) {
|
||||||
|
throw new Error('max attempts should be greater than or equal to 1');
|
||||||
|
}
|
||||||
|
this.maxAttempts = maxAttempts;
|
||||||
|
this.minSeconds = Math.floor(minSeconds);
|
||||||
|
this.maxSeconds = Math.floor(maxSeconds);
|
||||||
|
if (this.minSeconds > this.maxSeconds) {
|
||||||
|
throw new Error('min seconds should be less than or equal to max seconds');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
execute(action, isRetryable) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let attempt = 1;
|
||||||
|
while (attempt < this.maxAttempts) {
|
||||||
|
// Try
|
||||||
|
try {
|
||||||
|
return yield action();
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
if (isRetryable && !isRetryable(err)) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
core.info(err.message);
|
||||||
|
}
|
||||||
|
// Sleep
|
||||||
|
const seconds = this.getSleepAmount();
|
||||||
|
core.info(`Waiting ${seconds} seconds before trying again`);
|
||||||
|
yield this.sleep(seconds);
|
||||||
|
attempt++;
|
||||||
|
}
|
||||||
|
// Last attempt
|
||||||
|
return yield action();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getSleepAmount() {
|
||||||
|
return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
|
||||||
|
this.minSeconds);
|
||||||
|
}
|
||||||
|
sleep(seconds) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.RetryHelper = RetryHelper;
|
||||||
|
//# sourceMappingURL=retry-helper.js.map
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 986:
|
/***/ 986:
|
||||||
|
|||||||
3088
package-lock.json
generated
3088
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
40
package.json
40
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "actions-hugo",
|
"name": "actions-hugo",
|
||||||
"version": "2.4.5",
|
"version": "2.4.8",
|
||||||
"description": "GitHub Actions for Hugo",
|
"description": "GitHub Actions for Hugo",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
"npm": ">=6.13.7"
|
"npm": ">=6.13.7"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"all": "npm run format:check && npm run lint && npm test",
|
||||||
"lint": "eslint ./{src,__tests__}/**/*.ts",
|
"lint": "eslint ./{src,__tests__}/**/*.ts",
|
||||||
"lint:fix": "eslint --fix ./{src,__tests__}/**/*.ts",
|
"lint:fix": "eslint --fix ./{src,__tests__}/**/*.ts",
|
||||||
"test": "jest --coverage --verbose",
|
"test": "jest --coverage --verbose",
|
||||||
@@ -28,8 +29,7 @@
|
|||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"src/**/*.ts": [
|
"src/**/*.ts": [
|
||||||
"prettier --check",
|
"prettier --check",
|
||||||
"eslint",
|
"eslint"
|
||||||
"jest --bail --findRelatedTests"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -51,29 +51,29 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/peaceiris/actions-hugo#readme",
|
"homepage": "https://github.com/peaceiris/actions-hugo#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.2.2",
|
"@actions/core": "^1.2.3",
|
||||||
"@actions/exec": "^1.0.3",
|
"@actions/exec": "^1.0.3",
|
||||||
"@actions/io": "^1.0.2",
|
"@actions/io": "^1.0.2",
|
||||||
"@actions/tool-cache": "^1.3.1",
|
"@actions/tool-cache": "^1.3.3",
|
||||||
"node-fetch": "^2.6.0"
|
"node-fetch": "^2.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^25.1.1",
|
"@types/jest": "^25.1.4",
|
||||||
"@types/node": "^13.7.0",
|
"@types/node": "~12",
|
||||||
"@types/node-fetch": "^2.5.4",
|
"@types/node-fetch": "^2.5.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.19.0",
|
"@typescript-eslint/eslint-plugin": "^2.25.0",
|
||||||
"@typescript-eslint/parser": "^2.19.0",
|
"@typescript-eslint/parser": "^2.25.0",
|
||||||
"@zeit/ncc": "^0.21.0",
|
"@zeit/ncc": "^0.22.0",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^6.8.0",
|
||||||
"eslint-plugin-jest": "^23.6.0",
|
"eslint-plugin-jest": "^23.8.2",
|
||||||
"husky": "^4.2.1",
|
"husky": "^4.2.3",
|
||||||
"jest": "^25.1.0",
|
"jest": "^25.2.3",
|
||||||
"jest-circus": "^25.1.0",
|
"jest-circus": "^25.2.3",
|
||||||
"lint-staged": "^10.0.7",
|
"lint-staged": "^10.0.9",
|
||||||
"nock": "^11.7.2",
|
"nock": "^12.0.3",
|
||||||
"prettier": "1.19.1",
|
"prettier": "2.0.2",
|
||||||
"standard-version": "^7.1.0",
|
"standard-version": "^7.1.0",
|
||||||
"ts-jest": "^25.2.0",
|
"ts-jest": "^25.2.1",
|
||||||
"typescript": "^3.7.5"
|
"typescript": "^3.8.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user