mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-06 15:55:00 +00:00
Remove the commenting attempt
This commit is contained in:
parent
9fcd9c4c12
commit
42d3d703b5
32
.github/workflows/lint.yml
vendored
32
.github/workflows/lint.yml
vendored
@ -8,7 +8,6 @@ on:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
format_code:
|
format_code:
|
||||||
@ -22,35 +21,6 @@ jobs:
|
|||||||
clangformat: 17.0.5
|
clangformat: 17.0.5
|
||||||
|
|
||||||
- name: Run clang-format
|
- name: Run clang-format
|
||||||
id: clang_format
|
|
||||||
run: |
|
run: |
|
||||||
find include src -name '*.h' -o -name '*.cc' | xargs clang-format -i -style=file -fallback-style=none
|
find include src -name '*.h' -o -name '*.cc' | xargs clang-format -i -style=file -fallback-style=none
|
||||||
git diff | tee fmt.patch
|
git diff --exit-code
|
||||||
if [ -s fmt.patch ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
||||||
if: failure() && steps.clang_format.outcome == 'failure'
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.KEY }}
|
|
||||||
script: |
|
|
||||||
const fs = require('fs');
|
|
||||||
const patch = fs.readFileSync('fmt.patch', { encoding: 'utf8' });
|
|
||||||
const comment = `clang-format 17.0.5 found issues in the formatting in your code:
|
|
||||||
<details>
|
|
||||||
<summary>
|
|
||||||
View the diff from clang-format:
|
|
||||||
</summary>
|
|
||||||
|
|
||||||
\`\`\`diff
|
|
||||||
${patch}
|
|
||||||
\`\`\`
|
|
||||||
|
|
||||||
</details>
|
|
||||||
`;
|
|
||||||
await github.rest.issues.createComment({
|
|
||||||
issue_number: context.issue.number,
|
|
||||||
owner: context.repo.owner,
|
|
||||||
repo: context.repo.repo,
|
|
||||||
body: comment
|
|
||||||
});
|
|
||||||
|
Loading…
Reference in New Issue
Block a user