Skip to content

Commit 691cd3e

Browse files
committed
test: try auto-fix with strict (cpp-linter-action#543)
1 parent 3770f14 commit 691cd3e

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: strict + auto-fix
2+
3+
# Temporary e2e test of the auto-fix + strict fix on cpp-linter-action#543.
4+
5+
on:
6+
push:
7+
branches: [claude/project-thread-xqhq16]
8+
9+
permissions: {}
10+
11+
jobs:
12+
run:
13+
strategy:
14+
fail-fast: false
15+
max-parallel: 1 # both push to this branch; run one after the other
16+
matrix:
17+
include:
18+
- name: before-fix
19+
ref: 5623e7c10c3b4bc4b77e1b10b70f78fb1ee7ed1c
20+
- name: after-fix
21+
ref: 011dcbf81a8ac59209e8542da1fec9cc18e33703
22+
name: ${{ matrix.name }}
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: write
26+
steps:
27+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
28+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
29+
with:
30+
repository: cpp-linter/cpp-linter-action
31+
ref: ${{ matrix.ref }}
32+
path: .action-under-test
33+
persist-credentials: false
34+
- name: auto-fix + strict
35+
id: linter
36+
continue-on-error: true
37+
uses: ./.action-under-test
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
style: file
42+
tidy-checks: '-*'
43+
files-changed-only: false
44+
lines-changed-only: false
45+
ignore: .github|.action-under-test
46+
thread-comments: false
47+
auto-fix: true
48+
auto-fix-commit-msg: 'test: auto-fix commit from ${{ matrix.name }}'
49+
strict: true
50+
- name: Report
51+
if: always()
52+
shell: bash
53+
env:
54+
R: ${{ toJSON(steps.linter) }}
55+
BRANCH: ${{ github.ref_name }}
56+
run: |
57+
remote=$(git ls-remote origin "refs/heads/$BRANCH" | cut -f1)
58+
echo "RESULT ${{ matrix.name }} $(jq -c '{outcome, out: .outputs}' <<< "$R")"
59+
echo "RESULT ${{ matrix.name }} trigger=$GITHUB_SHA remote=$remote"
60+
git log --oneline -3 "$remote" 2>/dev/null || git fetch -q origin "$BRANCH" && git log --oneline -3 FETCH_HEAD

0 commit comments

Comments
 (0)