@cocreate/validation 1.22.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/FUNDING.yml +1 -1
- package/.github/workflows/automated.yml +18 -7
- package/CHANGELOG.md +433 -394
- package/CONTRIBUTING.md +6 -6
- package/README.md +21 -19
- package/demo/index.html +2 -2
- package/docs/index.html +4 -4
- package/package.json +9 -9
- package/src/index.js +98 -3
- package/src/validations/unique.js +0 -32
package/.github/FUNDING.yml
CHANGED
|
@@ -12,16 +12,27 @@ jobs:
|
|
|
12
12
|
- name: Checkout repository
|
|
13
13
|
uses: actions/checkout@v7
|
|
14
14
|
|
|
15
|
-
- name: Sync package.json description to GitHub
|
|
15
|
+
- name: Sync package.json description and keywords to GitHub repository
|
|
16
16
|
env:
|
|
17
|
-
|
|
17
|
+
GH_TOKEN: ${{ secrets.GITHUB }}
|
|
18
18
|
run: |
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
if [ ! -f package.json ]; then
|
|
20
|
+
echo "No package.json found; skipping repository metadata sync."
|
|
21
|
+
exit 0
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
DESCRIPTION=$(jq -r '.description // empty' package.json)
|
|
25
|
+
if [ -n "$DESCRIPTION" ]; then
|
|
26
|
+
gh api --method PATCH "repos/${GITHUB_REPOSITORY}" -f description="$DESCRIPTION"
|
|
27
|
+
else
|
|
28
|
+
echo "No package description found; leaving GitHub description unchanged."
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
if jq -e '.keywords | type == "array"' package.json >/dev/null; then
|
|
32
|
+
TOPICS=$(jq -c '.keywords | map(ascii_downcase | gsub("[^a-z0-9-]+"; "-") | gsub("(^-+|-+$)"; "") | .[0:50]) | map(select(length > 0)) | unique | .[0:20]' package.json)
|
|
33
|
+
printf '{"names":%s}' "$TOPICS" | gh api --method PUT -H "Accept: application/vnd.github+json" "repos/${GITHUB_REPOSITORY}/topics" --input -
|
|
23
34
|
else
|
|
24
|
-
echo "No
|
|
35
|
+
echo "No package keywords found; leaving GitHub topics unchanged."
|
|
25
36
|
fi
|
|
26
37
|
|
|
27
38
|
release:
|