2021-05-10 11:18:44 -07:00
|
|
|
name: PR Lint Format
|
2020-12-10 09:01:51 -08:00
|
|
|
|
lotus: Try to fix gh actions
Current error:
```
1s
Run trilom/file-changes-action@v1.2.4
/usr/bin/docker exec e94fda2c6b79f2a3fda6ad3973fb2452092507da89442d782b39afc8b41f24a4 sh -c "cat /etc/*release | grep ^ID"
Warning: Received event from pull_request, but also received a before(50eff5af7dc04b0a4875f13f14be50f1e279774c) or after(8bd0db74a78f63e77553e5800add3fad45783a1e) value.
I am assuming you want to use a Push event but forgot something, so I'm giving you a message.
Error: undefined
Exception: {
"error": "403/Unknown Error:HttpError",
"from": "undefined/Error",
"message": "There was an error getting change files for repo:qmk_firmware owner:FrameworkComputer pr:1",
"payload": "Resource not accessible by integration"
}
(node:128) UnhandledPromiseRejectionWarning: Error: {"error":"403/Unknown Error:HttpError","from":"undefined/Error","message":"There was an error getting change files for repo:qmk_firmware owner:FrameworkComputer pr:1","payload":"Resource not accessible by integration"}
at run (/__w/_actions/trilom/file-changes-action/v1.2.4/dist/index.js:1:19989)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:128) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:128) [DEP0018] DeprecationWarning: Unhandled promise rejections
are deprecated. In the future, promise rejections that are not handled
will terminate the Node.js process with a non-zero exit code.
```
Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-02-01 23:04:56 -08:00
|
|
|
#permissions:
|
|
|
|
# contents: read
|
2022-12-22 15:41:16 -08:00
|
|
|
|
2020-12-10 09:01:51 -08:00
|
|
|
on:
|
2021-05-10 11:18:44 -07:00
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- 'drivers/**'
|
|
|
|
- 'lib/arm_atsam/**'
|
|
|
|
- 'lib/lib8tion/**'
|
|
|
|
- 'lib/python/**'
|
|
|
|
- 'platforms/**'
|
|
|
|
- 'quantum/**'
|
|
|
|
- 'tests/**'
|
|
|
|
- 'tmk_core/**'
|
2020-12-10 09:01:51 -08:00
|
|
|
|
|
|
|
jobs:
|
2021-05-10 11:18:44 -07:00
|
|
|
lint:
|
2020-12-10 09:01:51 -08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-03-16 18:32:09 -07:00
|
|
|
container: ghcr.io/qmk/qmk_cli
|
2020-12-10 09:01:51 -08:00
|
|
|
|
|
|
|
steps:
|
2023-02-28 12:27:11 -08:00
|
|
|
- name: Disable safe.directory check
|
|
|
|
run : git config --global --add safe.directory '*'
|
|
|
|
|
2022-06-28 23:44:54 -07:00
|
|
|
- uses: actions/checkout@v3
|
2020-12-16 15:00:02 -08:00
|
|
|
with:
|
2021-05-10 11:18:44 -07:00
|
|
|
fetch-depth: 0
|
2020-12-10 09:01:51 -08:00
|
|
|
|
2022-02-22 10:24:18 -08:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pip3 install -r requirements-dev.txt
|
|
|
|
|
2022-11-28 12:04:04 -08:00
|
|
|
- name: Get changed files
|
2021-05-10 11:18:44 -07:00
|
|
|
id: file_changes
|
2023-06-23 13:53:24 -07:00
|
|
|
uses: tj-actions/changed-files@v37
|
2020-12-10 09:01:51 -08:00
|
|
|
|
2021-11-14 15:06:22 -08:00
|
|
|
- name: Run qmk formatters
|
2021-05-10 11:18:44 -07:00
|
|
|
shell: 'bash {0}'
|
2021-02-06 04:55:50 -08:00
|
|
|
run: |
|
2022-11-28 12:04:04 -08:00
|
|
|
echo '${{ steps.file_changes.outputs.added_files}}' '${{ steps.file_changes.outputs.modified_files}}' > ~/files_changed.txt
|
2021-11-22 17:40:53 -08:00
|
|
|
qmk format-c --core-only $(< ~/files_changed.txt) || true
|
2022-12-28 01:03:29 -08:00
|
|
|
#qmk format-python $(< ~/files_changed.txt) || true
|
2021-11-22 17:40:53 -08:00
|
|
|
qmk format-text $(< ~/files_changed.txt) || true
|
2021-02-06 04:55:50 -08:00
|
|
|
|
2021-11-14 15:06:22 -08:00
|
|
|
- name: Fail when formatting required
|
|
|
|
run: |
|
2021-11-20 14:45:12 -08:00
|
|
|
git diff
|
2021-11-14 15:06:22 -08:00
|
|
|
for file in $(git diff --name-only); do
|
2021-11-20 14:45:12 -08:00
|
|
|
echo "File '${file}' Requires Formatting"
|
|
|
|
echo "::error file=${file}::Requires Formatting"
|
2021-11-14 15:06:22 -08:00
|
|
|
done
|
|
|
|
test -z "$(git diff --name-only)"
|