Skip to content

Commit c0d368a

Browse files
committed
Refactor deploy action to streamline context handling by removing commented-out code and directly specifying context arguments, enhancing clarity and maintainability.
1 parent 5ce79b1 commit c0d368a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

actions/deploy/action.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,17 @@ runs:
7171
SECRETS_CONTEXT: ${{ inputs.secrets_context }}
7272
VARS_CONTEXT: ${{ inputs.vars_context }}
7373
run: |
74-
ARGS=()
75-
EMPTY_JSON=$(echo '{}' | base64 -w 0) # = e30K
74+
# ARGS=()
75+
# EMPTY_JSON=$(echo '{}' | base64 -w 0) # = e30K
7676
77-
[ -n "$GITHUB_CONTEXT" ] && [ "$GITHUB_CONTEXT" != "$EMPTY_JSON" ] && ARGS+=(--context "github:$GITHUB_CONTEXT")
78-
[ -n "$SECRETS_CONTEXT" ] && [ "$SECRETS_CONTEXT" != "$EMPTY_JSON" ] && ARGS+=(--context "secrets:$SECRETS_CONTEXT")
79-
[ -n "$VARS_CONTEXT" ] && [ "$VARS_CONTEXT" != "$EMPTY_JSON" ] && ARGS+=(--context "vars:$VARS_CONTEXT")
77+
# [ -n "$GITHUB_CONTEXT" ] && [ "$GITHUB_CONTEXT" != "$EMPTY_JSON" ] && ARGS+=(--context "github:$GITHUB_CONTEXT")
78+
# [ -n "$SECRETS_CONTEXT" ] && [ "$SECRETS_CONTEXT" != "$EMPTY_JSON" ] && ARGS+=(--context "secrets:$SECRETS_CONTEXT")
79+
# [ -n "$VARS_CONTEXT" ] && [ "$VARS_CONTEXT" != "$EMPTY_JSON" ] && ARGS+=(--context "vars:$VARS_CONTEXT")
8080
81-
storm agent run --context-format=base64 "${ARGS[@]}" -i ${{ inputs.inventory }} ${{ inputs.workflow }}
81+
# storm agent run --context-format=base64 "${ARGS[@]}" -i ${{ inputs.inventory }} ${{ inputs.workflow }}
82+
83+
storm agent run \
84+
--context-format=base64 \
85+
--context="github:$GITHUB_CONTEXT" \
86+
--context="secrets:$SECRETS_CONTEXT" \
87+
-i ${{ inputs.inventory }} ${{ inputs.workflow }}

0 commit comments

Comments
 (0)