Skip to content

Commit f6533c5

Browse files
committed
Check if new syntax for args works
1 parent 3ebb323 commit f6533c5

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

action.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ runs:
6666
with:
6767
python-version: '3.x'
6868

69+
- name: Set up pip cache
70+
uses: actions/cache@v3
71+
with:
72+
path: ~/.cache/pip
73+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
74+
restore-keys: |
75+
${{ runner.os }}-pip-
76+
6977
- name: Install dependencies
7078
shell: bash
7179
run: |
@@ -76,16 +84,23 @@ runs:
7684
id: autofix
7785
shell: bash
7886
run: |
79-
patchwork AutoFix \
80-
github_api_key=${{ inputs.github_token }} \
81-
${inputs.openai_api_key:+"openai_api_key=${{ inputs.openai_api_key }}"} \
82-
${inputs.patched_api_key:+"patched_api_key=${{ inputs.patched_api_key }}"} \
83-
model=${{ inputs.model }} \
84-
client_base_url=${{ inputs.client_base_url }} \
85-
vulnerability_limit=${{ inputs.vulnerability_limit }} \
86-
severity=${{ inputs.severity }} \
87-
compatibility=${{ inputs.compatibility }} \
88-
branch_prefix=${{ inputs.branch_prefix }} \
89-
disable_branch=${{ inputs.disable_branch }} \
90-
disable_pr=${{ inputs.disable_pr }} \
91-
force_pr_creation=${{ inputs.force_pr_creation }}
87+
args=()
88+
args+=("github_api_key=${{ inputs.github_token }}")
89+
if [ -n "${{ inputs.openai_api_key }}" ]; then
90+
args+=("openai_api_key=${{ inputs.openai_api_key }}")
91+
fi
92+
if [ -n "${{ inputs.patched_api_key }}" ]; then
93+
args+=("patched_api_key=${{ inputs.patched_api_key }}")
94+
fi
95+
args+=(
96+
"model=${{ inputs.model }}"
97+
"client_base_url=${{ inputs.client_base_url }}"
98+
"vulnerability_limit=${{ inputs.vulnerability_limit }}"
99+
"severity=${{ inputs.severity }}"
100+
"compatibility=${{ inputs.compatibility }}"
101+
"branch_prefix=${{ inputs.branch_prefix }}"
102+
"disable_branch=${{ inputs.disable_branch }}"
103+
"disable_pr=${{ inputs.disable_pr }}"
104+
"force_pr_creation=${{ inputs.force_pr_creation }}"
105+
)
106+
patchwork AutoFix "${args[@]}"

0 commit comments

Comments
 (0)