Skip to content

Commit 1e5ddc5

Browse files
authored
Merge branch 'main' into feat-1282
2 parents fc9a533 + 862740e commit 1e5ddc5

File tree

1,455 files changed

+55617
-31740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,455 files changed

+55617
-31740
lines changed

.github/workflows/black-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
- uses: jpetrucciani/black-check@master
1919
with:
2020
black_flags: '-S'
Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,17 @@
11
name: clang-format-linter
22

33
on:
4-
pull_request_target:
5-
types:
6-
- opened
7-
- edited
8-
- synchronize
9-
branches:
10-
- main
4+
push: {}
5+
pull_request: {}
116

127
jobs:
138
build:
149
runs-on: ubuntu-latest
1510

1611
steps:
17-
- uses: actions/checkout@v3
18-
19-
- uses: DoozyX/clang-format-lint-action@v0.13
12+
- uses: actions/checkout@v4
13+
- uses: DoozyX/clang-format-lint-action@v0.16.2
2014
with:
2115
source: '.'
2216
extensions: 'c,cpp,java'
23-
clangFormatVersion: 12
24-
inplace: True
25-
26-
- uses: EndBug/add-and-commit@v9
27-
with:
28-
committer_name: yanglbme
29-
committer_email: contact@yanglibin.info
30-
message: 'chore: format code with clang-format'
31-
env:
32-
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
17+
clangFormatVersion: 16

.github/workflows/compress.yml

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,50 @@
11
name: compress-images
22

33
on:
4-
schedule:
5-
- cron: "0 0 * * 3"
4+
pull_request:
5+
paths:
6+
- '**.jpg'
7+
- '**.jpeg'
8+
- '**.png'
9+
- '**.webp'
10+
push:
11+
branches:
12+
- main
13+
paths:
14+
- '**.jpg'
15+
- '**.jpeg'
16+
- '**.png'
17+
- '**.webp'
618
workflow_dispatch:
7-
19+
schedule:
20+
- cron: '00 23 * * 0'
821
jobs:
9-
compress:
22+
build:
23+
name: calibreapp/image-actions
1024
runs-on: ubuntu-latest
11-
if: github.repository == 'doocs/leetcode'
25+
# Only run on main repo on and PRs that match the main repo.
26+
if: |
27+
github.repository == 'doocs/leetcode' &&
28+
(github.event_name != 'pull_request' ||
29+
github.event.pull_request.head.repo.full_name == github.repository)
1230
steps:
1331
- name: Checkout Branch
14-
uses: actions/checkout@v2
15-
32+
uses: actions/checkout@v4
1633
- name: Compress Images
1734
id: calibre
1835
uses: calibreapp/image-actions@main
1936
with:
20-
githubToken: ${{ secrets.ACTION_TOKEN }}
21-
compressOnly: true
22-
23-
- name: Commit Files
24-
if: |
25-
steps.calibre.outputs.markdown != ''
26-
run: |
27-
git config --local user.email "szuyanglb@outlook.com"
28-
git config --local user.name "yanglbme"
29-
git commit -m "chore: auto compress images" -a
30-
31-
- name: Push Changes
37+
githubToken: ${{ secrets.GITHUB_TOKEN }}
38+
# For non-Pull Requests, run in compressOnly mode and we'll PR after.
39+
compressOnly: ${{ github.event_name != 'pull_request' }}
40+
- name: Create Pull Request
41+
# If it's not a Pull Request then commit any changes as a new PR.
3242
if: |
43+
github.event_name != 'pull_request' &&
3344
steps.calibre.outputs.markdown != ''
34-
uses: ad-m/github-push-action@master
45+
uses: peter-evans/create-pull-request@v4
3546
with:
36-
github_token: ${{ secrets.ACTION_TOKEN }}
47+
title: 'chore: auto compress images'
48+
branch-suffix: timestamp
49+
commit-message: 'chore: auto compress images'
50+
body: ${{ steps.calibre.outputs.markdown }}

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"semi": true,
55
"singleQuote": true,
66
"trailingComma": "all",
7+
"printWidth": 100,
78
"bracketSpacing": true,
89
"arrowParens": "avoid",
910
"phpVersion": "8.1",

0 commit comments

Comments
 (0)