Skip to content

Commit 2bd8b5b

Browse files
committed
Init
1 parent d0339de commit 2bd8b5b

24 files changed

Lines changed: 2327 additions & 0 deletions

.github/dependabot.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
cooldown:
9+
default-days: 7
10+
groups:
11+
github-actions-all:
12+
patterns:
13+
- "*"
14+
- package-ecosystem: composer
15+
directory: /
16+
schedule:
17+
interval: weekly
18+
cooldown:
19+
default-days: 7
20+
groups:
21+
composer-all:
22+
patterns:
23+
- "*"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# yamllint disable rule:line-length
2+
---
3+
name: action-inputs-sorted-check
4+
on:
5+
push:
6+
paths:
7+
- action.yml
8+
permissions:
9+
contents: read
10+
jobs:
11+
check-action-inputs-sorted:
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
15+
with:
16+
persist-credentials: false
17+
- name: Validate input key order in action.yml
18+
run: |
19+
inputs_file="action.yml"
20+
21+
current=$(yq e '.inputs | keys' "${inputs_file}" | sed 's/^- //')
22+
sorted=$(echo "${current}" | sort)
23+
24+
if [[ "${current}" != "${sorted}" ]]; then
25+
echo "❌ Inputs in ${inputs_file} are not sorted alphabetically."
26+
echo
27+
echo "🔍 Current order:"
28+
echo "${current}"
29+
echo
30+
echo "✅ Expected order:"
31+
echo "${sorted}"
32+
echo
33+
echo "🧩 Suggested changes (move lines):"
34+
35+
paste <(echo "${current}") <(echo "${sorted}") | awk '$1 != $2 { printf " Move \"%s\" to where \"%s\" is.\n", $1, $2 }'
36+
37+
exit 1
38+
else
39+
echo "✅ Inputs in ${inputs_file} are sorted alphabetically!"
40+
fi

.github/workflows/general.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# yamllint disable rule:line-length
2+
---
3+
name: General
4+
"on":
5+
pull_request:
6+
permissions:
7+
contents: read
8+
packages: read
9+
jobs:
10+
MCVS-general-action:
11+
strategy:
12+
matrix:
13+
args:
14+
- testing-type: lint-action
15+
- testing-type: lint-commit
16+
- testing-type: lint-git
17+
- testing-type: security-file-system
18+
- testing-type: yamllint
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22+
with:
23+
persist-credentials: false
24+
- uses: schubergphilis/mcvs-general-action@dd9e92cb0bf9e98226c0c13283e287781a6637a7 # v0.6.0
25+
with:
26+
testing-type: ${{ matrix.args.testing-type }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# yamllint disable rule:line-length
2+
---
3+
name: MCVS-PR-validation-action
4+
"on":
5+
pull_request:
6+
types:
7+
- edited
8+
- opened
9+
- reopened
10+
- synchronize
11+
workflow_call:
12+
permissions:
13+
contents: read
14+
pull-requests: read
15+
jobs:
16+
MCVS-PR-validation-action:
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
20+
with:
21+
persist-credentials: false
22+
- uses: schubergphilis/mcvs-pr-validation-action@6f153c01301ab2f92336781173b7f3a796de5f3e
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Package version updater
3+
"on":
4+
schedule:
5+
- cron: 42 5 * * 1
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
update-package-version-not-updated-by-dependabot:
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
14+
with:
15+
persist-credentials: false
16+
- env:
17+
DEPENDENCIES_LABEL: dependencies
18+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
PACKAGE_VERSION_UPDATER_BRANCH: package-version-updater
20+
BUILD_TASKFILE: build/task.yml
21+
run: ./scripts/package-version-updater.sh
22+
shell: bash

.github/workflows/php.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: php
3+
"on": pull_request
4+
permissions:
5+
contents: read
6+
packages: read
7+
jobs:
8+
mcvs-php-action:
9+
strategy:
10+
matrix:
11+
args:
12+
- testing-type: composer-validate
13+
- testing-type: security-composer-packages
14+
- testing-type: security-grype
15+
runs-on: ubuntu-24.04
16+
env:
17+
TASK_X_REMOTE_TASKFILES: 1
18+
steps:
19+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
20+
with:
21+
persist-credentials: false
22+
- uses: ./
23+
with:
24+
task-install: yes
25+
testing-type: ${{ matrix.args.testing-type }}
26+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/stale.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Close stale issues and PRs
3+
"on":
4+
schedule:
5+
- cron: 42 4 * * 1-5
6+
permissions:
7+
contents: write
8+
issues: write
9+
pull-requests: write
10+
jobs:
11+
stale:
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0
15+
with:
16+
days-before-stale: 63
17+
days-before-close: 21
18+
exempt-pr-labels: dependencies,security
19+
stale-issue-message: |
20+
Issue will be marked as stale because it has not been updated in a
21+
while.
22+
stale-pr-message: |
23+
PR will be marked as stale because it has not been updated in a
24+
while.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# yamllint disable rule:line-length
2+
---
3+
name: taskfile-sorted-units
4+
"on":
5+
push:
6+
permissions:
7+
contents: read
8+
jobs:
9+
taskfile-sorted-units:
10+
runs-on: ubuntu-24.04
11+
steps:
12+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
13+
with:
14+
persist-credentials: false
15+
- run: |
16+
check_sorted() {
17+
local task_name="$1"
18+
local keys
19+
20+
keys=$(yq e ".tasks.\"$task_name\" | keys | select(. != null)" ./build/task.yml | sed 's/^- //g')
21+
22+
if [[ "$keys" != "$(echo "$keys" | sort)" ]]; then
23+
echo "❌ Keys are not sorted in $task_name"
24+
echo "Expected:"
25+
echo "$keys" | sort
26+
echo
27+
echo "Found:"
28+
echo "$keys"
29+
exit 1
30+
fi
31+
}
32+
33+
for task in $(yq e '.tasks | keys' ./build/task.yml | sed 's/^- //g'); do
34+
check_sorted "${task}"
35+
done
36+
37+
echo "✅ All tasks have sorted keys!"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: taskfile-without-empty-lines
3+
"on":
4+
push:
5+
permissions:
6+
contents: read
7+
jobs:
8+
taskfile-without-empty-lines:
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
12+
with:
13+
persist-credentials: false
14+
- run: |
15+
yaml_file="./build/task.yml"
16+
empty_lines=$(grep -n -e '^$' "$yaml_file")
17+
18+
awk '
19+
BEGIN {
20+
in_block = 0;
21+
empty_line_found = 0;
22+
impacted_lines = "";
23+
}
24+
/^[[:space:]]*- *\|[[:space:]]*$/ {
25+
in_block = 1;
26+
next;
27+
}
28+
/^$/ {
29+
if (in_block == 0) {
30+
empty_line_found = 1;
31+
impacted_lines = impacted_lines NR ", ";
32+
}
33+
}
34+
{
35+
# Exit the block if a non-indented line is encountered
36+
if (in_block == 1 && match($0, /^[^[:space:]]/)) {
37+
in_block = 0;
38+
}
39+
}
40+
END {
41+
if (empty_line_found == 1) {
42+
# Remove the last comma and space from the string
43+
sub(/, $/, "", impacted_lines);
44+
print "Empty lines found at lines: " impacted_lines;
45+
exit 1;
46+
}
47+
}
48+
' "$yaml_file"
49+
exit_status=$?
50+
51+
if [[ $exit_status -ne 0 ]]; then
52+
echo "❌ Empty lines outside of '- |' blocks, found in $yaml_file:"
53+
exit 1
54+
fi
55+
56+
echo "✅ $yaml_file is without empty lines!"

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
.php-cs-fixer.cache
3+
.phpunit.cache
4+
.task
5+
.vscode
6+
build/coverage
7+
build/phar
8+
vendor

0 commit comments

Comments
 (0)