-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
61 lines (56 loc) · 1.47 KB
/
action.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: 'Hello World'
description: 'Greet someone'
inputs:
github_token:
description: 'A GitHub token to download direnv release with'
required: true
runs:
using: "composite"
steps:
- name: Install nix
uses: cachix/install-nix-action@v30
- uses: cachix/cachix-action@v15
with:
name: devenv
- name: Install devenv.sh
run: nix profile install --accept-flake-config github:cachix/devenv/latest
shell: sh
- name: Install direnv
shell: sh
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
run: |
os="$(uname -s | tr "[:upper:]" "[:lower:]")"
case "${os}" in
mingw*)
os=windows
;;
esac
case "$(uname -m)" in
x86_64)
arch=amd64
;;
i686 | i386)
arch=386
;;
aarch64 | arm64)
arch=arm64
;;
*)
echo "Machine $(uname -m) not supported by the direnv installer."
exit 1
;;
esac
gh release download -R direnv/direnv -p "direnv.${os}-${arch}" -O /usr/local/bin/direnv
chmod +x /usr/local/bin/direnv
direnv allow
- name: Load PATH changes
shell: sh
run: |
direnv allow
direnv exec . sh -c 'echo $PATH' > "$GITHUB_PATH"
- name: Load other environment changes
shell: sh
run: |
direnv allow
direnv export gha >> "$GITHUB_ENV"