Skip to content

Commit 9d8ef7b

Browse files
committed
feat: ✨ create act-run script
1 parent f96b643 commit 9d8ef7b

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

src/act/_act-run.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
# Source colors script
6+
. zz_colors
7+
8+
# Function to print help and manage arguments
9+
eval $(
10+
zz_args "Run act with predefined arguments" $0 "$@" <<-help
11+
help
12+
)
13+
14+
#### Goto repository root
15+
cd "$(git rev-parse --show-toplevel)" >/dev/null
16+
17+
for e in "SSH_KNOWN_HOSTS<ssh-keyscan -H ${KNOWN_HOST}" "SSH_PRIVATE_KEY" "SSH_CONFIG"; do
18+
19+
# extract the alias name from the first part of the string
20+
# and the underlying value from the second part
21+
a=$(echo "$e" | cut -d'<' -f1)
22+
v=$(echo "$e" | cut -d'<' -f2 -s)
23+
24+
# Set alias name to the value of the underlying variable
25+
if [ -n "$v" ]; then
26+
zz_log i "Setting <{B $a}>..."
27+
eval export $a="\$($v)"
28+
fi
29+
30+
# Build the argument to pass to act
31+
if [ -n "$(eval echo "\$$a")" ]; then
32+
zz_log i "Passing <{B $a}>..."
33+
ARGS="$ARGS --secret $a"
34+
fi
35+
36+
done
37+
38+
echo act --artifact-server-path ./.artifacts $ARGS "$@"
39+
40+
#### Back to previous directory
41+
cd - >/dev/null

src/act/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "act",
33
"name": "Nektos Act",
44
"description": "A tool for running GitHub Actions locally",
5-
"version": "1.4.2",
5+
"version": "1.5.0",
66
"dependsOn": {
77
"ghcr.io/devcontainers/features/docker-in-docker": {}
88
},

src/act/stubs/.artifacts/..gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore

0 commit comments

Comments
 (0)