Commit graph

62 commits

Author SHA1 Message Date
Sora Morimoto
3a0b1ebdc6
fix: add missing await to core.group calls (#305) 2025-10-31 08:34:27 -05:00
Gregor Zeitlinger
254003e261
fix: trim "v" prefix on update (#287)
Fixes https://github.com/jdx/mise-action/issues/285
2025-10-06 06:17:50 -05:00
Sébastien Maintrot
77a964b3e4
feat: use self-update to modify version if mise is already installed (#277)
Hello 👋 

1st of all thanks for your work on mise, it's really a game changer 😁 

## Why
This PR tries to address the issue #165 (mise-action cannot upgrade
mise)

## What
I've decided to use `mise self-update` if mise is already installed to
switch to the desired version
Let me know if this is an OK fix for you

## Tests
To test this feature, I've run the action on my repo and screenshot the
newly created output

<img width="591" height="538" alt="Screenshot 2025-10-01 at 22 14 46"
src="https://github.com/user-attachments/assets/9a10a33a-d86f-410b-8bdc-71b07b3036f6"
/>

The sha of the commit was suposed to match the sha of the screenshot,
but I've fixup and rebase the PR
Happy to do a new one if you want live proof

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> When mise is already installed, compare the requested `version` input
to the installed version and run `self-update` to align if they differ.
> 
> - **Action Logic (`src/index.ts`)**:
>   - **Existing Installation Handling**:
> - Read `version` input; fetch installed version via `mise version
--json`.
> - If versions differ, execute `mise self-update <version> -y`;
otherwise log that mise is already installed.
>   - Download path and SHA256 verification remain unchanged.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
941208cb9b7a6e796cdc7e96a8dcf6560d4d207c. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-03 11:43:01 +00:00
Risu
2f998c07b7
fix(cache): replace , in MISE_ENV with - (#278)
Fixes https://github.com/jdx/mise-action/issues/276

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Replaces commas in MISE_ENV with hyphens when constructing the cache
key to ensure stable/valid keys.
> 
> - **Cache Key Generation**:
> - In `src/index.ts`, normalizes `MISE_ENV` via `replace(/,/g, '-')`
and uses it as `mise_env` when building the cache key template.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
899df938a6. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
2025-10-01 19:16:12 -05:00
jdx
5e785b73cb
fix: redact secret values from env (#252) 2025-08-22 09:38:59 -05:00
Pedro Piñera Buendía
0f242c8c39
feat: add environment variable support to cache key templates (#250)
I added support for customizing the key, but forgot the most important
piece that we need, being able to reference an environment variable
value. Our CI runner provider is now exposing an environment variable
that indicates if the OS configuration changes, and we plan to use that
one to invalidate the cache, otherwise we get errors because the cached
dependencies are linking against an invalid / non-existent `glibc`
version.

> [!IMPORTANT]
> I wrote the code with `claude code` and reviewed it afterwards

## Summary (Claude-generated)
- Add support for `{{env.VAR_NAME}}` syntax in cache key templates to
allow reading environment variable values
- Enables more flexible cache key customization based on CI/CD
environment variables like branch names, deployment environments, or
custom build identifiers
- Maintains backward compatibility with existing cache key templates

## Examples
```yaml
# Include branch name from environment
cache_key: 'mise-{{env.GITHUB_REF_NAME}}-{{platform}}-{{file_hash}}'

# Use custom deployment environment
cache_key: 'mise-{{env.DEPLOY_ENV}}-{{platform}}-{{file_hash}}'

# Conditional logic with environment variables
cache_key: '{{default}}{{#if env.CUSTOM_SUFFIX}}-{{env.CUSTOM_SUFFIX}}{{/if}}'
```

## Changes
- Modified `processCacheKeyTemplate()` in `src/index.ts` to include
`process.env` in template data
- Updated `action.yml` documentation to include the new
`{{env.VAR_NAME}}` syntax
- All existing functionality remains unchanged

## Test plan
- [x] Build and package successfully with `npm run all`
- [x] Linting and formatting pass
- [ ] Manual testing with environment variables in cache key templates
- [ ] Verify backward compatibility with existing cache key
configurations
2025-08-22 05:04:00 -05:00
Pedro Piñera Buendía
d53c31b046
feat: add configurable cache key with template variable support (#246)
I closed [this PR](https://github.com/jdx/mise-action/pull/235) by
mistake so I'm reopening it.
2025-08-19 10:59:36 -05:00
Mael
f0b1d70eae
feat: export env vars from mise.toml (#241)
Solve https://github.com/jdx/mise-action/issues/36

BREAKING CHANGE: we're defaulting this behavior to `true`

---------

Co-authored-by: jdx <216188+jdx@users.noreply.github.com>
2025-08-18 16:33:13 +00:00
jdx
adbb7adcf1
feat: allow fetching binary from mise.jdx.dev (#227)
THANKS CLOUDFLARE FOR PROJECT ALEXANDRIA
2025-07-24 06:09:13 +00:00
Andrew Driggs
b64166e6f5
Fix flag passed to mise reshim (#208)
* Fix flag passed to `mise reshim`

* chore: update dist after build
2025-07-15 17:30:41 -07:00
Gregor Zeitlinger
ca07392817
support checksum (#218)
* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum

* support checksum
2025-07-12 06:17:19 -05:00
jdx
233d283dd6
Revert "add all MISE_ env vars to cache key (#197)"
This reverts commit a5b33d7b88.
2025-06-25 11:54:34 -05:00
Mate Molnar
d24e3836a6
feat: pass github token for mise calls (#205) 2025-06-25 07:20:55 -05:00
Gregor Zeitlinger
a5b33d7b88
add all MISE_ env vars to cache key (#197)
Co-authored-by: jdx <216188+jdx@users.noreply.github.com>
2025-06-17 17:12:06 +00:00
Andrew Driggs
883a83c54f
Add reshim flag to reshim after setup (#202) 2025-06-17 02:03:19 -05:00
Prashant V
367a97c7a9
Add MISE_ENV to cache key if set (#196)
Fixes #169
2025-05-26 19:13:00 -05:00
Victor LEFEBVRE
923c9f44ed
Fix alpine container installation (#189)
* Change test tool for future alpine CI testing

* replace node with jq as it doesnt require any build on alpine

* Fix alpine musl container install

* add tests around mise install in alpine container

* add support for musl os
Fixes: https://github.com/jdx/mise-action/issues/186

* alpine needs bash to run test.sh script

* remove unneeded logs

* Update test.yml

* Update test.yml
2025-05-12 07:15:17 -05:00
jdx
4a07a7ced0
fix: show message when saving cache 2025-04-22 22:54:30 -05:00
jdx
81d53cf968
fix: save cache when build fails
Fixes #99
2025-04-22 22:41:39 -05:00
Ville Skyttä
5e190f2e46
feat: run mise ls (#163) 2025-01-05 18:43:06 +00:00
jdx
b82835fe1f
fix: use tar.gz if zstd is not available (#159)
Fixes #155
2024-12-30 16:44:25 +00:00
jdx
2408f570e1
chore: use github releases (#154) 2024-12-23 13:59:01 -06:00
jdx
370e73c4f0
feat: fetch tarball with zst compression (#153) 2024-12-23 19:31:53 +00:00
Risu
2d33c855a3
fix: fix cache_save option (#144) 2024-11-18 13:20:21 -06:00
Frederik Boster
7b77be967a
fix: use correct glob format for cache key file hash (#139) 2024-11-06 14:43:47 +00:00
jdx
57eda1a45f
fix: use lockfile for cache key 2024-11-04 10:26:21 -06:00
Maximilian Remming
fb230aa558
fix: overwrite MISE_LOG_LEVEL when in debug mode (#138)
As the log_level parameter defaults to info the MISE_LOG_LEVEL
environment variable needs to be overriden or otherwise it is not set.
This also means that mise-action will always run with debug logging when
it is ran with debugging enabled, no matter what log level the user has
set.
2024-10-29 07:08:34 -05:00
Jeff Dickey
86b003e69f
chore: fetch mise compressed 2024-10-27 20:20:20 -05:00
Jeff Dickey
c20c9ebb8b
chore: fetch mise compressed 2024-10-27 20:18:38 -05:00
Risu
f2a7466821
fix: add install_args hash to cache key (#136)
* fix: add install_args hash to cache key

* fix: sort tools before hashing
2024-10-26 06:25:44 -05:00
Maximilian Remming
cc7f0e6690
feat: use debug logging when in debug mode (#128) (#129)
* feat: use debug logging when in debug mode (#128)

* chore: remove unnecessary getExperimental function

* chore: fix setupMise typing

As `core.getInput` returns always a string, the type of `version` in
`setupMise` should be just a `string`. When the string is empty it means
to use the latest version. This could be made cleaner but this is how it
works.

* feat: only set MISE_LOG_LEVEL when required

Previously MISE_LOG_LEVEL was always set, even when log_level parameter
wasn't configured. This changes that behaviour so that the environment
variable is only set when log_level is set by the user and that the
MISE_LOG_LEVEL is set to debug only for this action when in debug mode.

---------

Co-authored-by: Jeff Dickey <216188+jdx@users.noreply.github.com>
2024-10-25 16:48:49 +00:00
jdx
477762426f
fix: cache_save boolean bug (#135)
Fixes #130
2024-10-25 14:03:09 +00:00
jdx
1b7ab9b9c1
fix: cache mise bin (#134)
Fixes #133
2024-10-24 01:27:00 +00:00
jdx
5d3e058edf
feat: support windows (#122) 2024-09-25 21:27:52 +00:00
Risu
3a6b71561b
feat: added config filenames to hashFiles (#86) 2024-06-01 17:27:09 -05:00
jdx
5f5bc9d57c
feat: allow passing args to install (#87) 2024-06-01 11:10:28 -05:00
Jeff Dickey
4541e25ef8
fix: rename "install_dir" config to "working_directory"
This fits in better with other actions
2024-06-01 10:37:21 -05:00
Jeff Dickey
b42d5a2f42
feat: added log level config 2024-05-12 10:19:03 -05:00
Jeff Dickey
5424b1f50b
added more config filenames to cache key 2024-01-12 18:40:58 -06:00
Jeff Dickey
a05bde45a6
rename rtx -> mise 2024-01-02 17:15:35 -06:00
Jeff Dickey
2c307d8ed6
rtx -> mise 2024-01-02 16:16:49 -06:00
Pedro Piñera Buendía
10161a135f
Add API to enable the experimental features (#220)
* Add option to enable experimental features

* Add .rtx.toml to install the tools necessary to work on this repository
2023-12-24 19:15:25 +00:00
jdx
55e5d18e74
added rtx_dir config (#215)
* added rtx_dir config

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip
2023-12-14 08:38:00 -06:00
jdx
5ac46849ac
added rtx_toml support (#214)
* added rtx_toml support

Fixes #47

* refactor

* refactor

* bump

* bump

* bump
2023-12-14 07:56:58 -06:00
jdx
a545a9b90a
pinning (#213)
* pinning

Fixes #205

* gh

* gh

* gh

* gh

* docs
2023-12-14 12:39:54 +00:00
Robbie Plankenhorn
0e7059cb40
Added ability to disable automatic action caching. (#212) 2023-12-12 15:04:07 -06:00
Jeff Dickey
f0a88fe39d
use new asset host 2023-12-11 16:37:16 -06:00
FalkWoldmann
78e75c3fe1
Use 1 instead of yes because it can be parsed (#204) 2023-12-07 14:40:42 +00:00
jdx
d661017ade
updated action template base from actions/typescript-action (#170) 2023-10-16 19:18:57 -05:00
Yuya Kusakabe
50bd58fbe0
Add install option to skip rtx install (#146) 2023-09-15 00:49:51 +00:00