Azure / Azure/bicep-deploy

Add handling of previously installed bicep executable

Open
#166 2 comments 2 reactions 0 assignees View on GitHub
Area - Bicep Install enhancement help wanted
Dominant language
TypeScript
Stars
64
Forks
20
Avg merge
15h 37m
Merged PRs (30d)
4

Description

The compileBicep and compipeBicepParams functions in helpers/file.ts will try to install bicep from github.com regardless of whether it is already available on the runner's PATH. This makes the action unusable in runners that have no direct internet access.

As a workaround I've added to the functions the following:

```typescript
// needs import { which } from "@actions/io";
const bicepFilePath: string = await which('bicep', false);

const bicepPath = !bicepFilePath || bicepFilePath.trim() == "" ? await Bicep.install(tmpdir()) : bicepFilePath;
```
Since bicepPath already is being used, I just added the option to look for each locally before attempting to install it.

If you find that this is worth implementing, this is how I got it working with a local fork.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.