Skip to content

Commit

Permalink
Add config option
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Jan 2, 2025
1 parent 7a55b60 commit d98d553
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 41 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-ghcup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
with:
stack-hook: true
version: ${{ matrix.version }}
config:
url-source: StackSetupURL
verbose: true

- run: ghcup config
- run: ghcup debug-info
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ inputs:
stack-hook:
description: Install the GHCup stack hook (GHCs are installed through ghcup)
default: false
config:
description: GHCup config (partial or full)
default: null

outputs:
path:
Expand Down
Binary file modified ghcup/bun.lockb
Binary file not shown.
218 changes: 178 additions & 40 deletions ghcup/dist/index.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion ghcup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.1"
"@actions/tool-cache": "^2.0.1",
"yaml": "^2.7.0"
}
}
2 changes: 2 additions & 0 deletions ghcup/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { main, getInputAsBool } from "./main.ts";
import core from "@actions/core";
import YAML from 'yaml'

try {
main({
version: core.getInput("version"),
release_channels: core.getMultilineInput("release-channels"),
stack_hook: getInputAsBool("stack-hook"),
config: YAML.parse(core.getInput("config")),
});
} catch (error) {
core.setFailed((error as Error).message);
Expand Down
1 change: 1 addition & 0 deletions ghcup/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export type Opts = {
version: string;
release_channels: string[];
stack_hook: boolean;
config: boolean;
};

export async function main(opts: Opts) {
Expand Down

0 comments on commit d98d553

Please sign in to comment.