Skip to content

Commit 9d139d2

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.5
2 parents 5f73576 + da0bddf commit 9d139d2

6 files changed

Lines changed: 65 additions & 46 deletions

File tree

.github/workflows/label-add-conflict.yml renamed to .github/workflows/label-add-conflict-all-pr.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
name: Auto Add Label "stale" & Comment Conflicts
1+
name: Auto Label "stale" for All PRs
22

33
on:
44
push:
55
branches:
66
- develop
77
- '4.*'
8-
pull_request:
9-
branches:
10-
- develop
11-
- '4.*'
128

139
jobs:
14-
auto-label-comment-conflict:
10+
build:
11+
name: Check Conflicts
1512

1613
permissions:
1714
contents: read
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Auto Label "stale"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- '4.*'
8+
9+
jobs:
10+
build:
11+
name: Check Conflicts
12+
runs-on: ubuntu-22.04
13+
permissions:
14+
contents: read
15+
pull-requests: write
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Get PR Detail
22+
id: PR-detail
23+
run: echo "detail=$(gh pr view $PR_URL --json mergeable,url,labels)" >> $GITHUB_OUTPUT
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
PR_URL: ${{ github.event.pull_request.html_url }}
27+
28+
- name: 'Remove label "stale"'
29+
env:
30+
PR_DETAIL: ${{ steps.PR-detail.outputs.detail }}
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
PR_URL: ${{ github.event.pull_request.html_url }}
33+
run: |
34+
35+
# MERGEABLE with 'stale' label
36+
if [ "$(echo $PR_DETAIL | jq -r '.mergeable')" == "MERGEABLE" ] && \
37+
[ "$(echo $PR_DETAIL | jq -r '.labels[] | select(.name == "stale")')" != "" ]; then
38+
# remove 'stale' label
39+
gh pr edit $PR_URL --remove-label "stale"
40+
fi
41+
42+
- name: 'Check for conflicts and add label/comment'
43+
env:
44+
PR_DETAIL: ${{ steps.PR-detail.outputs.detail }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
PR_URL: ${{ github.event.pull_request.html_url }}
47+
AUTHOR: ${{ github.event.pull_request.user.login }}
48+
run: |
49+
50+
# CONFLICTING with no "stale" label,
51+
if [ "$(echo $PR_DETAIL | jq -r '.mergeable')" == "CONFLICTING" ] && \
52+
[ "$(echo $PR_DETAIL | jq -r '.labels[] | select(.name == "stale")')" == "" ]; then
53+
# add label
54+
gh pr edit $PR_URL --add-label "stale"
55+
# add comment
56+
gh pr comment $PR_URL --body ":wave: Hi, @$AUTHOR!<br><br>We detected conflicts in your PR against the base branch :speak_no_evil:<br>You may want to sync :arrows_counterclockwise: your branch with upstream!<br><br>Ref: [Syncing Your Branch](https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#pushing-your-branch)"
57+
fi

‎.github/workflows/label-remove-conflict.yml‎

Lines changed: 0 additions & 39 deletions
This file was deleted.

‎user_guide_src/source/changelogs/v4.4.0.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ Others
277277
Message Changes
278278
***************
279279

280+
- Added ``Core.invalidDirectory`` error message.
280281
- Improved ``HTTP.invalidHTTPProtocol`` error message.
281282

282283
Changes

‎user_guide_src/source/libraries/validation.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@ To give a labeled error message you can set up as:
311311

312312
.. _validation-withrequest:
313313

314+
.. note:: ``setRules()`` will overwrite any rules that were set previously. To add more than one
315+
rule to an existing set of rules, use ``setRule()`` multiple times.
316+
314317
Setting Rules for Array Data
315318
============================
316319

‎user_guide_src/source/libraries/validation/007.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
// or
88
$validation->setRules([
99
'username' => ['label' => 'Username', 'rules' => 'required|max_length[30]'],
10-
'password' => ['label' => 'Password', 'rules' => ['required', '|max_length[255]', 'min_length[10]']],
10+
'password' => ['label' => 'Password', 'rules' => ['required', 'max_length[255]', 'min_length[10]']],
1111
]);

0 commit comments

Comments
 (0)