Commit Graph
100 Commits
Author SHA1 Message Date
b1937e141c fix: Hugo package naming fix (#688)
## Summary

Rebases the Hugo package naming fix from #609 on top of the current
`main` branch, including the installer flow added in #687.

- Derive Hugo release asset OS and architecture naming conventions from
the requested Hugo version.
- Apply those conventions when selecting OS and architecture segments,
including the 0.102.x macOS universal boundary, 0.103+ downcased OS
names, Windows zip assets, and Linux ARM assets.
- Add table-driven tests for pre-0.102, 0.102.x, and 0.103+ naming
behavior, plus URL coverage for the corrected release asset names.

## Changes

- Add `getConventions` to centralize version-based release asset naming
decisions.
- Update `getOS` and `getArch` to use convention flags for macOS,
lower-case OS names, standardized architecture names, and the Windows
ARM support boundary.
- Update `getURL` to generate candidate URLs for downcased Windows and
Linux assets, and for darwin universal archives.
- Wire convention detection into `installer` before generating candidate
Hugo release asset URLs.
- Expand unit coverage for OS, architecture, convention, and URL
behavior.

## Checklist

- [x] I have read the latest README and followed the instructions.
- [x] I have added or updated tests for behavior changes.
- [x] README.md and action.yml updates are not needed because inputs and
action metadata are unchanged.
- [x] I have run the relevant verification commands.

## References

- Rebased follow-up for
https://github.com/peaceiris/actions-hugo/pull/609
- References https://github.com/peaceiris/actions-hugo/issues/605 and
https://github.com/peaceiris/actions-hugo/issues/608
- Based on `main` after
https://github.com/peaceiris/actions-hugo/pull/687

## Verification

- [x] `RUNNER_TEMP=/private/tmp npm run all`
- [ ] `npm run build` was not run because this branch does not update
bundled output and current `main` removed `lib/index.js`.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Version-aware conventions control OS and architecture naming,
including macOS universal asset support and expanded darwin/macOS
patterns.

* **Refactor**
* Conventions centralized and applied across installer and URL
generation; OS/arch inputs accept varied casing and naming variants.

* **Tests**
* Expanded, data-driven parameterized tests for conventions, OS/arch
mappings, URL variants, and error cases.
* Replaced network stubs with deterministic fetch-mock helpers for test
isolation.

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/peaceiris/actions-hugo/pull/688)
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Michael T Lombardi <michael.t.lombardi@gmail.com>
Co-authored-by: codefactor-io <support@codefactor.io>
Co-authored-by: Codex <noreply@openai.com>
2026-05-11 00:23:26 +09:00
Shohei UedaandCodex 189731ef00 build: update npm dependencies (#689)
## Summary

Update all direct npm dependencies and devDependencies to the current
npm latest versions and pin them exactly instead of using caret or tilde
ranges.

## Changes

- Pin all direct runtime and development package versions in
`package.json` and refresh `package-lock.json`.
- Migrate ESLint from `.eslintrc.json` to flat config for ESLint 10.
- Update Jest and TypeScript configuration and test mocks to support the
latest ESM-only packages.
- Add response status handling and typed JSON access for the latest
`node-fetch` types.

## Checklist

- [x] I have read the latest README and followed the instructions.
- [x] I have added or updated tests for behavior changes.
- [x] I have updated README.md and action.yml when inputs or runtime
behavior changed.
- [x] I have run the relevant verification commands.

## Verification

- [x] `npm --userconfig=/private/tmp/empty-npmrc outdated --json
--include=dev` returned `{}`
- [x] `npm run all`
- [x] `npm run build`


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Added comprehensive test mocks for Actions APIs and fetch, improved
integration tests, and updated assertions for more precise error
validation.
  * Configured Jest to map external modules to local test mocks.

* **Chores**
* Migrated ESLint to the flat config format and replaced prior ESLint
config.
* Updated project dependencies and modernized TypeScript compiler
settings.

* **Refactor**
* Adjusted exported tool constants and made error handling more explicit
in version-fetching logic.

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/peaceiris/actions-hugo/pull/689)
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Codex <noreply@openai.com>
2026-05-10 23:30:59 +09:00
peaceirisandCodex e3c35ac635 docs: document build artifact constraint
Co-Authored-By: Codex <noreply@openai.com>
2026-05-10 22:45:44 +09:00
peaceiris 8a69ba55a5 chore: delete lib/index.js 2026-05-10 22:42:05 +09:00
Shohei UedaandCodex 187a5efe81 feat: support renamed Hugo release assets (#687)
## Summary
- Support multiple Hugo release asset names for Linux, macOS, and
Windows so renamed upstream assets no longer fail with a plain 404.
- Preserve compatibility with legacy Hugo assets that used filename
forms such as `hugo_v0.20.3_*`, macOS `.zip` archives, and
`Linux_ARM`-style names.
- Add retry handling for missing candidate assets and macOS `.pkg`
extraction via `pkgutil --expand-full`, with focused URL and installer
tests plus the rebuilt `lib/index.js` bundle.

## References
- Fixes https://github.com/peaceiris/actions-hugo/issues/652
- `hugo-version: latest` still resolves through Homebrew; this change
does not fall back to an older Hugo version when the resolved release
has no compatible asset.
- Review note: `lib/index.js` is generated by `npm run build` and
contains bundled dependency code.

## Test plan
- [x] `RUNNER_TEMP=/tmp npm run all`
- [x] `npm run build`


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Broadened test coverage for asset URL generation, download retry
behavior, and extraction across OSes and architectures.

* **Bug Fixes**
* More resilient installer with multiple candidate download URLs and
retry handling for transient failures.
* Improved extraction logic to correctly handle platform- and
format-specific archives.

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/peaceiris/actions-hugo/pull/687)
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Codex <noreply@openai.com>
2026-05-10 22:40:55 +09:00
peaceirisandCodex d488e4d987 docs: add pull request template
Co-Authored-By: Codex <noreply@openai.com>
2026-05-10 21:44:58 +09:00
peaceiris 20e81489be chore(release): Remove build assets [skip ci] 2026-05-10 18:43:22 +09:00
peaceiris 32c7754570 chore(release): 3.1.0 2026-05-10 18:43:21 +09:00
peaceiris 62903c46a1 chore(release): Add build assets 2026-05-10 18:43:19 +09:00
Shohei Ueda 64e0f66acb ci: harden workflows and update Node.js (#686) 2026-05-10 18:21:41 +09:00
peaceiris fd1a667089 chore: add .codex/ 2026-05-10 01:23:17 +09:00
peaceirisandCodex ba5146cb8a docs: add contributor guidelines
Co-Authored-By: Codex <codex@openai.com>
2026-05-10 00:35:35 +09:00
Shohei Ueda 7db63f5e7f docs: bump actions/cache to v4 2024-04-17 13:52:48 +09:00
peaceiris 1b06a03d21 chore(release): Remove build assets [skip ci] 2024-04-02 12:17:51 +09:00
peaceiris 75d2e84710 chore(release): 3.0.0 2024-04-02 12:17:50 +09:00
peaceiris e482f7ce0f chore(release): Add build assets 2024-04-02 12:17:49 +09:00
peaceiris d85452eadf chore: revert version 2024-04-02 12:16:58 +09:00
peaceiris 01bd2b16cc build: node 20.11.1 2024-04-02 09:33:47 +09:00
peaceiris 966dfad385 chore: npm audit fix 2024-02-06 23:49:51 +09:00
Shohei Ueda 3d92e2fd55 docs: replace set-output with GITHUB_OUTPUT
close https://github.com/peaceiris/actions-hugo/issues/633
2023-05-05 23:18:27 +09:00
peaceiris 4910870eaa chore(release): Remove build assets [skip ci] 2022-10-24 00:28:24 +09:00
peaceiris 16361eb4ac chore(release): 2.6.0 2022-10-24 00:28:23 +09:00
peaceiris 2eb0f86851 chore(release): Add build assets 2022-10-24 00:28:16 +09:00
Shohei Ueda 9a77c647c2 feat: bump node12 to node16 (#617)
Close https://github.com/peaceiris/actions-hugo/issues/611

- deps: bump node12 to node16
- deps: bump @actions/core from 1.6.0 to 1.10.0
2022-10-24 00:26:51 +09:00
Shohei Ueda 8da14cc542 chore: fix year (#613) 2022-10-16 01:19:10 +09:00
Shohei Ueda 4809af4bd4 ci: add actions/dependency-review-action v1 2022-04-11 00:25:28 +09:00
peaceiris 0401e3b43f bump actions 2022-03-19 15:49:14 +09:00
Shohei Ueda ba23c24d3a ci: Remove updating npm 2022-02-25 13:54:09 +09:00
peaceiris 3476bf7e65 Use hugo v0.91.2 for examples 2021-12-24 09:39:58 +09:00
Shohei Ueda 6eea37b1f9 Bump actions/cache from v1 to v2 2021-10-22 09:30:46 +09:00
Shohei Ueda 21c525440c Change trigger branch from main to master
The docsy template has the master branch 

https://github.com/google/docsy-example
2021-10-20 14:30:57 +09:00
Shohei Ueda 7d37d3a39a Disable Bug Report 2021-10-20 12:44:59 +09:00
Shohei Ueda a5a80db759 Bump doctoc from 2.0.0 to 2.1.0 (#545) 2021-10-14 13:01:48 +09:00
peaceiris c91cecd7e1 Fix typo 2021-08-11 03:40:08 +09:00
peaceiris 4083be1363 deps: node 12.22.4 2021-08-11 03:39:20 +09:00
Shohei Ueda 5fa8f53e89 chore: Fix prettier (#535) 2021-07-26 15:32:36 +09:00
peaceiris 068938ab22 docs: Improve if syntax 2021-07-21 05:43:02 +09:00
peaceiris c1f39e2b46 chore: update url 2021-07-12 12:31:30 +09:00
peaceiris 5fb41c87da chore: Convert templates to YAML issue forms 2021-07-12 12:27:21 +09:00
peaceiris 20d6724b2c docs: Improve concurrency usage 2021-07-12 10:12:47 +09:00
peaceiris 903b94526d docs: Use ubuntu-20.04 2021-07-12 02:30:55 +09:00
peaceiris 8d746f09e2 docs: Add concurrency 2021-07-12 02:22:39 +09:00
Shohei Ueda 101470c99f ci: add resolved 2021-06-26 04:08:37 +09:00
Shohei Ueda 5d8b0b2005 ci: Change event from published to released 2021-05-28 22:31:47 +09:00
peaceiris 41a402c64b chore(release): Remove build assets [skip ci] 2021-05-27 13:04:55 +09:00
peaceiris c03b5dbed2 chore(release): 2.5.0 2021-05-27 13:04:54 +09:00
peaceiris d282fd0d5e chore(release): Add build assets 2021-05-27 13:04:53 +09:00
peaceiris f3792d95d8 deps: npm audit fix 2021-05-27 13:04:26 +09:00
peaceiris 65bdbf15ab docs: Add pull_request event 2021-05-17 23:35:24 +09:00
Shohei Ueda 6b42ea1676 ci: Drop ubuntu-16.04 (#513) 2021-05-01 22:10:56 +09:00
Shohei Ueda b67469730c deps: Bump node from 12.22.0 to 12.22.1 (#510) 2021-04-19 02:32:32 +09:00
Shohei Ueda 5d548aa7b6 deps: Bump node from 12.21.0 to 12.22.0 (#503) 2021-04-01 18:21:51 +09:00
Shohei Ueda da36599fbf deps: bump node from 12.20.1 to 12.21.0 (#500) 2021-03-09 23:47:43 +09:00
peaceiris fbae6cf1c8 docs: Bump hugo from 0.79.1 to 0.81.0 2021-03-08 15:57:56 +09:00
Shohei Ueda e53f8d69e5 docs: Bump actions/setup-node from v1 to v2 2021-03-08 15:55:41 +09:00
Shohei Ueda 0590f912fc docs: Add Non-ascii Filename section (#499) 2021-03-08 15:52:26 +09:00
peaceiris e77b89094b chore: update husky config 2021-03-06 23:08:18 +09:00
Shohei Ueda 9f50a3c912 deps: update devDependencies (#498) 2021-03-06 23:07:08 +09:00
peaceiris 917a09767d chore: Add postinstall for husky install 2021-03-06 23:04:54 +09:00
peaceiris d2e1e740d0 chore: npx husky install 2021-03-06 23:03:40 +09:00
Shohei Ueda a6b1a4cb03 build: Set target to ES2019 (#497) 2021-03-06 21:29:10 +09:00
peaceiris c3d587365f chore: fix husky 2021-03-06 21:10:28 +09:00
peaceiris 4f6ebdd767 ci: Fix husky post-merge 2021-02-10 14:15:02 +09:00
Shohei Ueda 32f5b71c41 deps: update devDependencies (#492) 2021-02-10 13:52:39 +09:00
Shohei Ueda 029d5ce0d0 ci: Fix husky post-merge (#491) 2021-02-10 13:47:06 +09:00
peaceiris 9564982d19 ci: Migrate husky from v4 to v5 2021-02-09 19:30:33 +09:00
peaceiris da35efefa8 ci: Remove skipci job 2021-02-09 19:28:11 +09:00
peaceiris 612b00fe8f deps: Bump npm to v7 2021-02-05 15:16:43 +09:00
Shohei Ueda b2b9041dc7 ci: remove CODECOV_TOKEN (#490) 2021-01-10 13:35:44 +09:00
Shohei Ueda 10834f4404 deps: bump node from 12.20.0 to 12.20.1 (#489) 2021-01-08 16:27:58 +09:00
peaceiris b0fb91bc02 docs: bump versions 2020-12-20 01:45:27 +09:00
peaceiris 8808a28020 deps: bump node from 12.19.1 to 12.20.0 2020-12-02 12:50:52 +09:00
Shohei Ueda ecc43610c0 chore: add link to Actions Documentation
GitHub Actions official documentation
https://docs.github.com/en/free-pro-team@latest/actions
2020-11-29 20:03:41 +09:00
Shohei Ueda 35b8c49468 chore: update link to github.community
GitHub Support Community Forum GitHub Actions category
old https://github.community/c/github-actions
new https://github.community/c/code-to-cloud/github-actions/41
2020-11-29 19:59:56 +09:00
Shohei Ueda ff64ad3cd4 ci: remove options no longer needed (#474) 2020-11-23 13:48:24 +09:00
Shohei Ueda 21d2e6ea58 deps: bump node from 12.19.0 to 12.19.1 (#471)
Open #472
2020-11-21 11:27:14 +09:00
Shohei Ueda d2b6644a80 deps: update devDependencies (#466) 2020-11-12 22:55:44 +09:00
Shohei Ueda 0df2d4252f deps: update dev deps (#462) 2020-10-21 18:01:18 +09:00
Shohei Ueda a7dd10985c docs: update title position 2020-10-13 18:05:40 +09:00
Shohei Ueda a448002cc3 ci: allow dependency-type production 2020-10-13 10:17:48 +09:00
Shohei Ueda a5336818df deps: update (#459) 2020-10-12 15:26:57 +09:00
Shohei Ueda d183b58fee deps: bump node from 12.18.4 to 12.19.0 (#458) 2020-10-12 12:06:29 +09:00
peaceiris b1548a6acb chore(release): Remove build assets [skip ci] 2020-10-07 01:12:19 +09:00
peaceiris 2e89aa66d0 chore(release): 2.4.13 2020-10-07 01:12:19 +09:00
peaceiris 8286aeefb8 chore(release): Add build assets 2020-10-07 01:12:17 +09:00
peaceiris 18a809e6c9 docs: Add Caching Hugo Modules 2020-10-01 04:26:48 +09:00
peaceiris 4245d14847 docs: add full docker image 2020-10-01 01:23:25 +09:00
Shohei Ueda 01cbeb899c deps: bump node from 12.18.3 to 12.18.4 (#446) 2020-09-19 08:16:37 +09:00
Shohei Ueda 71168fab79 docs: add note about branch to deploy (#419) 2020-08-25 09:37:31 +09:00
Shohei Ueda aba4ae3195 deps: change @zeit/ncc to @vercel/ncc (#416) 2020-08-22 12:07:50 +09:00
Shohei Ueda ca4532b6bc deps: bump node from 12.18.2 to 12.18.3 2020-07-29 17:27:05 +09:00
Shohei Ueda 61b002f4ff deps: bump git from 2.27.0 to 2.28.0 (#398) 2020-07-28 02:20:31 +09:00
Shohei Ueda 3462f4d33f docs: Add Code Scanning workflow badge 2020-07-23 11:21:29 +09:00
peaceiris 89d2e2c7e8 docs: bump hugo from 0.74.1 to 0.74.2 2020-07-18 03:20:18 +09:00
Shohei Ueda 71327d4646 chore: disable deno on vscode (#388) 2020-07-17 16:08:23 +09:00
Shohei Ueda 1eeaa0edab ci: add workflow_dispatch 2020-07-17 15:50:48 +09:00
Shohei Ueda da2d5466d3 chore: change default branch from master to main (#386) 2020-07-17 15:38:09 +09:00
peaceiris 18a17a77a8 docs: bump hugo from 0.71.1 to 0.74.1 2020-07-14 12:19:06 +09:00
Shohei Ueda 2fa902b35f ci: add codeql workflow 2020-07-07 16:46:50 +09:00
Shohei Ueda 96f56dee02 deps: bump node from 12.18.1 to 12.18.2 (#376) 2020-07-02 22:38:14 +09:00