mirror of
https://github.com/wearepixel/laravel-cart.git
synced 2026-11-14 13:51:44 +00:00
Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cab17cdc72 | ||
|
|
8f99b148d6 | ||
|
|
6bd569cca7 | ||
|
|
63d310bf7e | ||
|
|
c9163a7d78 | ||
|
|
45ef72894b | ||
|
|
c6ec19121c | ||
|
|
c8baf7f0a8 | ||
|
|
0ea24eb419 | ||
|
|
917d530006 | ||
|
|
d56ce61dec | ||
|
|
11d734e848 | ||
|
|
07d155159d | ||
|
|
45362d3c62 |
@@ -0,0 +1,18 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[docker-compose.yml]
|
||||
indent_size = 4
|
||||
@@ -0,0 +1,11 @@
|
||||
* text=auto eol=lf
|
||||
|
||||
*.blade.php diff=html
|
||||
*.css diff=css
|
||||
*.html diff=html
|
||||
*.md diff=markdown
|
||||
*.php diff=php
|
||||
|
||||
/.github export-ignore
|
||||
CHANGELOG.md export-ignore
|
||||
.styleci.yml export-ignore
|
||||
@@ -8,6 +8,7 @@ updates:
|
||||
open-pull-requests-limit: 10
|
||||
groups:
|
||||
actions:
|
||||
applies-to: version-updates
|
||||
patterns: ["*"]
|
||||
commit-message:
|
||||
prefix: "chore"
|
||||
@@ -23,9 +24,13 @@ updates:
|
||||
open-pull-requests-limit: 10
|
||||
groups:
|
||||
php-minor-patch:
|
||||
applies-to: version-updates
|
||||
update-types:
|
||||
- "minor"
|
||||
- "patch"
|
||||
php-security:
|
||||
applies-to: security-updates
|
||||
patterns: ["*"]
|
||||
commit-message:
|
||||
prefix: "chore"
|
||||
include: "scope"
|
||||
|
||||
@@ -1,32 +1,59 @@
|
||||
name: dependabot-auto-merge
|
||||
on: pull_request_target
|
||||
name: Dependabot Auto-merge
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Tests"]
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
dependabot:
|
||||
auto-merge:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
if: |
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
github.event.workflow_run.event == 'pull_request' &&
|
||||
github.event.workflow_run.actor.login == 'dependabot[bot]'
|
||||
|
||||
steps:
|
||||
|
||||
- name: Dependabot metadata
|
||||
id: metadata
|
||||
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
|
||||
with:
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
- name: Auto-merge Dependabot PRs for semver-minor updates
|
||||
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
|
||||
run: gh pr merge --auto --merge "$PR_URL"
|
||||
- name: Find PR and check update type
|
||||
id: check
|
||||
env:
|
||||
PR_URL: ${{github.event.pull_request.html_url}}
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
|
||||
run: |
|
||||
PR_DATA=$(gh pr list --repo "${{ github.repository }}" --head "$HEAD_BRANCH" --json number,title,url,author --jq '.[0]')
|
||||
|
||||
- name: Auto-merge Dependabot PRs for semver-patch updates
|
||||
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
|
||||
run: gh pr merge --auto --merge "$PR_URL"
|
||||
PR_URL=$(echo "$PR_DATA" | jq -r '.url')
|
||||
PR_AUTHOR=$(echo "$PR_DATA" | jq -r '.author.login')
|
||||
PR_TITLE=$(echo "$PR_DATA" | jq -r '.title')
|
||||
|
||||
echo "pr_url=$PR_URL" >> $GITHUB_OUTPUT
|
||||
|
||||
if [ "$PR_AUTHOR" != "app/dependabot" ]; then
|
||||
echo "is_safe=false" >> $GITHUB_OUTPUT
|
||||
echo "Not a Dependabot PR, skipping."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Parse major version numbers from title: "bump X from A[.B.C] to D[.E.F]"
|
||||
# Works for both "from 4.0.0 to 4.1.0" and "from 4 to 6" (GitHub Actions)
|
||||
FROM_MAJOR=$(echo "$PR_TITLE" | grep -oP 'from \K[0-9]+')
|
||||
TO_MAJOR=$(echo "$PR_TITLE" | grep -oP 'to \K[0-9]+')
|
||||
|
||||
echo "PR: $PR_TITLE (major: $FROM_MAJOR -> $TO_MAJOR)"
|
||||
|
||||
if [ "$FROM_MAJOR" = "$TO_MAJOR" ]; then
|
||||
echo "is_safe=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "is_safe=false" >> $GITHUB_OUTPUT
|
||||
echo "Major version bump, skipping auto-merge."
|
||||
fi
|
||||
|
||||
- name: Merge minor and patch updates
|
||||
if: steps.check.outputs.is_safe == 'true'
|
||||
run: gh pr merge --merge "${{ steps.check.outputs.pr_url }}"
|
||||
env:
|
||||
PR_URL: ${{github.event.pull_request.html_url}}
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
name: Dependabot Slack Alert
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
name: Notify Slack of major update
|
||||
runs-on: ubuntu-latest
|
||||
if: github.actor == 'dependabot[bot]'
|
||||
steps:
|
||||
- name: Check if major version bump
|
||||
id: check
|
||||
env:
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
run: |
|
||||
from_major=$(echo "$PR_TITLE" | grep -oP 'from \K[0-9]+' | head -1)
|
||||
to_major=$(echo "$PR_TITLE" | grep -oP 'to \K[0-9]+' | head -1)
|
||||
|
||||
if [ -n "$from_major" ] && [ -n "$to_major" ] && [ "$from_major" != "$to_major" ]; then
|
||||
echo "is_major=true" >> $GITHUB_OUTPUT
|
||||
echo "Major bump detected: $from_major -> $to_major"
|
||||
else
|
||||
echo "is_major=false" >> $GITHUB_OUTPUT
|
||||
echo "Minor/patch bump, skipping"
|
||||
fi
|
||||
|
||||
- name: Send Slack alert
|
||||
if: steps.check.outputs.is_major == 'true'
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
if [ -z "$SLACK_WEBHOOK_URL" ]; then
|
||||
echo "SLACK_WEBHOOK_URL not configured for this repo, skipping"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
payload=$(jq -n \
|
||||
--arg repo "$REPO" \
|
||||
--arg title "$PR_TITLE" \
|
||||
--arg url "$PR_URL" \
|
||||
--arg pr "#$PR_NUMBER" \
|
||||
'{
|
||||
blocks: [
|
||||
{
|
||||
type: "section",
|
||||
text: {
|
||||
type: "mrkdwn",
|
||||
text: ":dependabot: *Major dependency update requires review*"
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "section",
|
||||
fields: [
|
||||
{type: "mrkdwn", text: ("*Repository*\n`" + $repo + "`")},
|
||||
{type: "mrkdwn", text: ("*Pull Request*\n<" + $url + "|" + $pr + ">") }
|
||||
]
|
||||
},
|
||||
{
|
||||
type: "section",
|
||||
text: {
|
||||
type: "mrkdwn",
|
||||
text: $title
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "context",
|
||||
elements: [
|
||||
{
|
||||
type: "mrkdwn",
|
||||
text: "Major version bumps are not auto-merged as they may contain breaking changes."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
type: "actions",
|
||||
elements: [
|
||||
{
|
||||
type: "button",
|
||||
text: {type: "plain_text", text: "Review PR"},
|
||||
url: $url,
|
||||
style: "primary"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}')
|
||||
|
||||
curl -s -o /dev/null -w "%{http_code}" -X POST "$SLACK_WEBHOOK_URL" \
|
||||
-H "Content-type: application/json" \
|
||||
--data "$payload" | grep -q "^200$" \
|
||||
&& echo "Slack notification sent" \
|
||||
|| echo "Slack notification failed"
|
||||
Generated
+21
-21
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "56b40d3f17cc40f1b62c3f71a3601af7",
|
||||
"content-hash": "adce585bac784ac7803d7be6f7172a3f",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brick/math",
|
||||
@@ -5415,16 +5415,16 @@
|
||||
},
|
||||
{
|
||||
"name": "laravel/pint",
|
||||
"version": "v1.29.1",
|
||||
"version": "v1.32.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/pint.git",
|
||||
"reference": "0770e9b7fafd50d4586881d456d6eb41c9247a80"
|
||||
"reference": "006bd7825eb01daf92959d060b89cd9514fe4253"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/pint/zipball/0770e9b7fafd50d4586881d456d6eb41c9247a80",
|
||||
"reference": "0770e9b7fafd50d4586881d456d6eb41c9247a80",
|
||||
"url": "https://api.github.com/repos/laravel/pint/zipball/006bd7825eb01daf92959d060b89cd9514fe4253",
|
||||
"reference": "006bd7825eb01daf92959d060b89cd9514fe4253",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5432,17 +5432,19 @@
|
||||
"ext-mbstring": "*",
|
||||
"ext-tokenizer": "*",
|
||||
"ext-xml": "*",
|
||||
"php": "^8.2.0"
|
||||
"php": "^8.3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^3.95.1",
|
||||
"illuminate/view": "^12.56.0",
|
||||
"larastan/larastan": "^3.9.6",
|
||||
"laravel-zero/framework": "^12.1.0",
|
||||
"mockery/mockery": "^1.6.12",
|
||||
"composer/semver": "^3.4.4",
|
||||
"friendsofphp/php-cs-fixer": "^3.95.25",
|
||||
"illuminate/view": "^13.31.0",
|
||||
"larastan/larastan": "^3.11.0",
|
||||
"laravel-zero/framework": "^13.0.0",
|
||||
"laravel/agent-detector": "^2.0.2",
|
||||
"laravel/prompts": "^0.3.24",
|
||||
"mockery/mockery": "^1.6.15",
|
||||
"nunomaduro/termwind": "^2.4.0",
|
||||
"pestphp/pest": "^3.8.6",
|
||||
"shipfastlabs/agent-detector": "^1.1.3"
|
||||
"pestphp/pest": "^4.7.8"
|
||||
},
|
||||
"bin": [
|
||||
"builds/pint"
|
||||
@@ -5479,7 +5481,7 @@
|
||||
"issues": "https://github.com/laravel/pint/issues",
|
||||
"source": "https://github.com/laravel/pint"
|
||||
},
|
||||
"time": "2026-04-20T15:26:14+00:00"
|
||||
"time": "2026-09-10T10:47:55+00:00"
|
||||
},
|
||||
{
|
||||
"name": "mockery/mockery",
|
||||
@@ -6520,11 +6522,11 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "2.2.x-dev",
|
||||
"version": "2.3.5",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/5c0bbadd35255710f7d2402cd6213a0bc34cfa34",
|
||||
"reference": "5c0bbadd35255710f7d2402cd6213a0bc34cfa34",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/645a1bd6bead15fc1b8474137467961d0fa30a79",
|
||||
"reference": "645a1bd6bead15fc1b8474137467961d0fa30a79",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -6533,7 +6535,6 @@
|
||||
"conflict": {
|
||||
"phpstan/phpstan-shim": "*"
|
||||
},
|
||||
"default-branch": true,
|
||||
"bin": [
|
||||
"phpstan",
|
||||
"phpstan.phar"
|
||||
@@ -6581,7 +6582,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-06-05T16:36:10+00:00"
|
||||
"time": "2026-11-03T12:14:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
@@ -8254,8 +8255,7 @@
|
||||
"aliases": [],
|
||||
"minimum-stability": "dev",
|
||||
"stability-flags": {
|
||||
"larapack/dd": 20,
|
||||
"phpstan/phpstan": 20
|
||||
"larapack/dd": 20
|
||||
},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
{
|
||||
"preset": "laravel",
|
||||
"rules": {
|
||||
"concat_space": {
|
||||
"spacing": "one"
|
||||
},
|
||||
"class_attributes_separation": false,
|
||||
"ordered_imports": {
|
||||
"sort_algorithm": "length"
|
||||
"preset": "laravel",
|
||||
"rules": {
|
||||
"concat_space": {
|
||||
"spacing": "one"
|
||||
},
|
||||
"class_attributes_separation": false,
|
||||
"ordered_imports": {
|
||||
"sort_algorithm": "length"
|
||||
},
|
||||
"not_operator_with_space": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public function handle(): int
|
||||
}
|
||||
|
||||
$this->info("Driver created: app/Cart/Drivers/{$name}.php");
|
||||
$this->line(" Register it in config/cart.php under <comment>drivers</comment>.");
|
||||
$this->line(" Register it with <comment>Cart::extend()</comment> in a service provider's boot() method, then set 'driver' to its name in config/cart.php.");
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user