Skip to content

Commit a6d2ae9

Browse files
chore: add pre-merge check for newline in perf-changelog.yaml (#579)
* chore: add pre-merge check for newline in perf-changelog.yaml Add a validation step in run-sweep.yml that ensures perf-changelog.yaml ends with a newline character. This prevents negative diff issues in subsequent PRs when the file is appended to. Closes #578 Co-authored-by: Cameron Quilici <cquil11@users.noreply.github.com> * test * change logic of newline check * trigger test check * remove test perf changelog --------- Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Cameron Quilici <cquil11@users.noreply.github.com>
1 parent faed07c commit a6d2ae9

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/run-sweep.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ on:
2222
- "perf-changelog.yaml"
2323

2424
jobs:
25+
check-newline:
26+
runs-on: ubuntu-latest
27+
if: github.event_name == 'pull_request' && !github.event.pull_request.draft
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+
32+
- name: Check perf-changelog.yaml ends with newline
33+
run: |
34+
if [ -n "$(tail -c 1 perf-changelog.yaml)" ]; then
35+
echo "::error::perf-changelog.yaml must end with a newline character"
36+
echo "Please add a newline at the end of the file to avoid diff issues in subsequent PRs."
37+
exit 1
38+
fi
39+
2540
setup:
2641
runs-on: ubuntu-latest
2742
if: >-

0 commit comments

Comments
 (0)