Skip to content

Commit 02d1e4a

Browse files
authored
feat: install_allow_scripts input in setup-deno action (#50)
1 parent 59ee664 commit 02d1e4a

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

actions/setup-deno/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ This action sets up [Deno](https://deno.com/) for use in actions. The version of
55

66
## Action inputs
77

8-
| Input | Description | Default |
9-
| ------------------- | -------------------------------------------------------- | -------- |
10-
| `deno_version_file` | The path to the file containing the Deno version to use. | `''` |
11-
| `deno_version` | The specific Deno version to use. | `'v2.x'` |
8+
| Input | Description | Default |
9+
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
10+
| `deno_version_file` | The path to the file containing the Deno version to use. | `''` |
11+
| `deno_version` | The specific Deno version to use. | `'v2.x'` |
12+
| `install_allow_scripts` | Comma-separated list of scripts to allow when running the [`deno i --allow-scripts`](https://docs.deno.com/runtime/reference/cli/install/#options-allow-scripts) command. | `''` |
1213

1314
## Example usage
1415

actions/setup-deno/action.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ inputs:
1212
required: false
1313
default: 'v2.x'
1414

15+
install_allow_scripts:
16+
description: 'Comma-separated list of scripts to allow when running the `deno i --allow-scripts` command.'
17+
required: false
18+
default: ''
19+
1520
runs:
1621
using: composite
1722
steps:
@@ -24,4 +29,13 @@ runs:
2429

2530
- name: Install dependencies
2631
shell: bash
27-
run: deno i --frozen=true
32+
env:
33+
INSTALL_ALLOW_SCRIPTS: ${{ inputs.install_allow_scripts }}
34+
run: |
35+
cmd="deno i --frozen=true"
36+
37+
if [ -n "$INSTALL_ALLOW_SCRIPTS" ]; then
38+
cmd="$cmd --allow-scripts=$INSTALL_ALLOW_SCRIPTS"
39+
fi
40+
41+
$cmd

0 commit comments

Comments
 (0)