Skip to content

Commit 3cccd1f

Browse files
authored
feat: Update to remove repository folders after use (#5)
* feat: Update to remove repository folders after use * remove whitespace
1 parent 95c3a33 commit 3cccd1f

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

action.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,14 @@ runs:
8282
8383
- name: Process size (HEAD)
8484
shell: bash
85-
working-directory: head/${{ inputs.app_path }}
8685
run:
87-
python ${{ github.action_path }}/idf_size_report.py --in-file idf_size.json --out-file size.json --flash-total-override "${{ inputs.flash_total_override }}" || echo '{"flash":0,"dram":0,"iram":0,"ram":0}' > size.json
86+
python ${{ github.action_path }}/idf_size_report.py --in-file head/${{ inputs.app_path }}/idf_size.json --out-file head_size.json --flash-total-override "${{ inputs.flash_total_override }}" || echo '{"flash":0,"dram":0,"iram":0,"ram":0}' > head_size.json
87+
88+
# delete the head directory
89+
- name: Clean up head directory
90+
shell: bash
91+
run: |
92+
rm -rf head
8893
8994
- name: Determine base ref
9095
id: determine_base_ref
@@ -170,26 +175,31 @@ runs:
170175
- name: Process size (BASE)
171176
if: ${{ steps.determine_base_ref.outputs.has_base_ref == 'true' }}
172177
shell: bash
173-
working-directory: base/${{ inputs.app_path }}
174178
run:
175-
python ${{ github.action_path }}/idf_size_report.py --in-file idf_size.json --out-file size.json --flash-total-override "${{ inputs.flash_total_override }}" || echo '{"flash":0,"dram":0,"iram":0,"ram":0}' > size.json
179+
python ${{ github.action_path }}/idf_size_report.py --in-file base/${{ inputs.app_path }}/idf_size.json --out-file base_size.json --flash-total-override "${{ inputs.flash_total_override }}" || echo '{"flash":0,"dram":0,"iram":0,"ram":0}' > base_size.json
176180

177181
- name: Create empty base size (no base ref)
178182
if: ${{ steps.determine_base_ref.outputs.has_base_ref == 'false' }}
179183
shell: bash
180184
run: |
181-
mkdir -p base/${{ inputs.app_path }}
182-
echo '{"flash":0,"dram":0,"iram":0,"ram":0}' > base/${{ inputs.app_path }}/size.json
185+
echo '{"flash":0,"dram":0,"iram":0,"ram":0}' > base_size.json
186+
187+
# delete the base directory
188+
- name: Clean up base directory
189+
if: ${{ steps.determine_base_ref.outputs.has_base_ref == 'true' }}
190+
shell: bash
191+
run: |
192+
rm -rf base
183193
184194
- name: Make markdown
185195
id: mkdown
186196
shell: bash
187197
run: |
188198
# generate markdown
189199
if [ "${{ steps.determine_base_ref.outputs.has_base_ref }}" = "true" ]; then
190-
md=$(${{ steps.id_python_313.outputs.python-path }} ${{ github.action_path }}/render_markdown.py --app-name "${{ inputs.app_name }}" --base-name "${{ steps.determine_base_ref.outputs.base_name }}" --head-name "${{ steps.determine_base_ref.outputs.head_name }}" --head-json head/${{ inputs.app_path }}/size.json --base-json base/${{ inputs.app_path }}/size.json)
200+
md=$(${{ steps.id_python_313.outputs.python-path }} ${{ github.action_path }}/render_markdown.py --app-name "${{ inputs.app_name }}" --base-name "${{ steps.determine_base_ref.outputs.base_name }}" --head-name "${{ steps.determine_base_ref.outputs.head_name }}" --head-json head_size.json --base-json base_size.json)
191201
else
192-
md=$(${{ steps.id_python_313.outputs.python-path }} ${{ github.action_path }}/render_markdown.py --app-name "${{ inputs.app_name }}" --head-name "${{ steps.determine_base_ref.outputs.head_name }}" --head-json head/${{ inputs.app_path }}/size.json --no-base)
202+
md=$(${{ steps.id_python_313.outputs.python-path }} ${{ github.action_path }}/render_markdown.py --app-name "${{ inputs.app_name }}" --head-name "${{ steps.determine_base_ref.outputs.head_name }}" --head-json head_size.json --no-base)
193203
fi
194204
# append to summary and set output
195205
echo "$md" >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)