Files
llvm/.github/workflows/pr-code-format.yml
Mend Renovate 2fd3bf3680 [Github] Update GHA Dependencies (major) (#161108)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[actions/attest-build-provenance](https://redirect.github.com/actions/attest-build-provenance)
| action | major | `v1.4.4` -> `v3.0.0` |
| [actions/checkout](https://redirect.github.com/actions/checkout) |
action | major | `v4.3.0` -> `v5.0.0` |
|
[actions/github-script](https://redirect.github.com/actions/github-script)
| action | major | `v7.1.0` -> `v8.0.0` |
|
[actions/github-script](https://redirect.github.com/actions/github-script)
| action | major | `v6.4.1` -> `v8.0.0` |
| [actions/labeler](https://redirect.github.com/actions/labeler) |
action | major | `v4.3.0` -> `v6.0.1` |
| [actions/setup-node](https://redirect.github.com/actions/setup-node) |
action | major | `v4.4.0` -> `v6.0.0` |
|
[actions/setup-python](https://redirect.github.com/actions/setup-python)
| action | major | `v5.6.0` -> `v6.0.0` |
|
[github/codeql-action](https://redirect.github.com/github/codeql-action)
| action | major | `v2.28.1` -> `v4.31.2` |
|
[github/codeql-action](https://redirect.github.com/github/codeql-action)
| action | major | `v3.31.2` -> `v4.31.2` |
| [node](https://redirect.github.com/actions/node-versions) | uses-with
| major | `18` -> `24` |
|
[tj-actions/changed-files](https://redirect.github.com/tj-actions/changed-files)
| action | major | `v46.0.5` -> `v47.0.0` |
2025-11-06 15:39:56 -08:00

65 lines
1.8 KiB
YAML

name: "Check code formatting"
permissions:
contents: read
on:
pull_request:
branches:
- main
- 'users/**'
jobs:
code_formatter:
runs-on: ubuntu-24.04
container:
image: 'ghcr.io/llvm/ci-ubuntu-24.04-format'
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
if: github.repository == 'llvm/llvm-project'
steps:
- name: Fetch LLVM sources
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47.0.0
with:
separator: ","
skip_initial_fetch: true
base_sha: 'HEAD~1'
sha: 'HEAD'
- name: "Listed files"
env:
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Formatting files:"
echo "$CHANGED_FILES"
- name: Run code formatter
env:
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
# Create an empty comments file so the pr-write job doesn't fail.
run: |
echo "[]" > comments &&
python ./llvm/utils/git/code-format-helper.py \
--write-comment-to-file \
--token ${{ secrets.GITHUB_TOKEN }} \
--issue-number $GITHUB_PR_NUMBER \
--start-rev HEAD~1 \
--end-rev HEAD \
--changed-files "$CHANGED_FILES"
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
if: always()
with:
name: workflow-args
path: |
comments