bips
bips copied to clipboard
scripts/diffcheck.sh: Use secure temp files and git archive for better safety
Summary
Refactor scripts/diffcheck.sh to improve security and reliability by replacing fixed /tmp paths with secure temporary directories and avoiding destructive git checkout.
Changes
- Secure temp files: Use
mktemp -dwith automatic cleanup viatrapinstead of hardcoded/tmppaths - Non-destructive git operations: Replace
git checkout HEAD^withgit archiveto avoid modifying working tree state
I didn't really write that code. The reason I'm on blame is because of the move that happened in #1432.
That said, this PR seems to unnecessarily complicate things. This script is meant to be run in Github Actions. It's not meant to be run by users, and doesn't need "better safety". I have no strong opinion on the subject though so if others think this is useful, go ahead.
Thank you for the feedback @kallewoof.