Skip to content

Commit

Permalink
Add version input
Browse files Browse the repository at this point in the history
  • Loading branch information
tfausak authored and mrkkrp committed Feb 15, 2023
1 parent 102ddc5 commit 2bf8470
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Unreleased

* Added the `version` input which allows the user to select the Ormolu
version explicitly. It defaults to the latest version known.

## Ormolu action v10

* Uses Ormolu 0.5.3.0.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and its formatted version.
(default: true).
* `follow-symbolic-links` Whether to follow symbolic links (default: true).
* `extra-args` Extra arguments to pass to Ormolu.
* `version` The version number of Ormolu to use. Defaults to `"latest"`.

## Windows

Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ inputs:
required: false
description: >
Extra arguments to pass to Ormolu.
version:
required: false
description: >
The version number of Ormolu to use. Defaults to "latest".
default: latest
runs:
using: 'node16'
main: 'dist/index.js'
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ const tool_cache = __webpack_require__(7784);
const exec = __webpack_require__(1514);
const glob = __webpack_require__(8090);

const ormolu_version = '0.5.3.0';
const input_version = core.getInput('version');
const ormolu_version = input_version === 'latest' ? '0.5.3.0' : input_version;
const ormolu_linux_url = 'https://github.com/tweag/ormolu/releases/download/' + ormolu_version + '/ormolu-Linux.zip';
const ormolu_windows_url = 'https://github.com/tweag/ormolu/releases/download/' + ormolu_version + '/ormolu-Windows.zip';
const ormolu_macos_url = 'https://github.com/tweag/ormolu/releases/download/' + ormolu_version + '/ormolu-macOS.zip';
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const tool_cache = require('@actions/tool-cache');
const exec = require('@actions/exec');
const glob = require('@actions/glob');

const ormolu_version = '0.5.3.0';
const input_version = core.getInput('version');
const ormolu_version = input_version === 'latest' ? '0.5.3.0' : input_version;
const ormolu_linux_url = 'https://github.com/tweag/ormolu/releases/download/' + ormolu_version + '/ormolu-Linux.zip';
const ormolu_windows_url = 'https://github.com/tweag/ormolu/releases/download/' + ormolu_version + '/ormolu-Windows.zip';
const ormolu_macos_url = 'https://github.com/tweag/ormolu/releases/download/' + ormolu_version + '/ormolu-macOS.zip';
Expand Down

0 comments on commit 2bf8470

Please sign in to comment.