autowarefoundation / autoware-github-actions

Apache License 2.0
17 stars 24 forks source link

fix(sync-files): keep original source file intact #297

Closed xmfcx closed 5 months ago

xmfcx commented 5 months ago

Description

Instead of modifying the source file in place, first copy it to a temp location with mktemp, then do all the modifications and copy to dest path as usual.

Currently it modifies the source files in place.

If multiple versions are to be created from the same source file, it will modify them multiple times, breaking files.

Tests performed

Tested with the temporary v-test-sync-files tag. By calling it from:

Without this PR

image

With this PR

image

Effects on system behavior

Not applicable.

Interface changes

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

After all checkboxes are checked, anyone who has write access can merge the PR.