Skip to content

Commit 3f7febd

Browse files
authored
Update Workflows (#3)
1 parent 5af3dea commit 3f7febd

11 files changed

+297
-311
lines changed

.github/workflows/lint.yaml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: "Lint"
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches: [master]
8+
9+
jobs:
10+
lint:
11+
name: "Lint"
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
15+
steps:
16+
- name: "Checkout"
17+
uses: actions/checkout@v4
18+
19+
- name: "Setup Node 22"
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22
23+
#cache: npm
24+
25+
- name: "Install"
26+
id: install
27+
run: |
28+
npm install
29+
30+
- name: "ESLint"
31+
if: ${{ always() }}
32+
run: |
33+
npm run lint
34+
35+
- name: "Prettier"
36+
if: ${{ always() }}
37+
run: |
38+
npm run prettier
39+
40+
build:
41+
name: "Build"
42+
runs-on: ubuntu-latest
43+
timeout-minutes: 5
44+
45+
steps:
46+
- name: "Checkout"
47+
uses: actions/checkout@v4
48+
49+
- name: "Setup Node 22"
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: 22
53+
#cache: npm
54+
55+
- name: "Install"
56+
run: |
57+
npm install
58+
59+
- name: "Build"
60+
run: |
61+
npm run build
62+
63+
- name: "Verify"
64+
run: |
65+
git status --porcelain dist/
66+
if [ ! -d "dist" ];then
67+
echo "Missing dist directory, run: npm build"
68+
exit 1
69+
fi
70+
if [ -n "$(git status --porcelain dist)" ];then
71+
echo "Build was not run, run: npm build"
72+
exit 1
73+
fi

.github/workflows/mirror.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: "Mirror"
22

33
on:
44
workflow_dispatch:
5-
release:
6-
types: ["published"]
75
push:
86
branches: ["**"]
97
tags: ["**"]
@@ -21,7 +19,7 @@ jobs:
2119
fetch-depth: 0
2220

2321
- name: "Mirror to Codeberg"
24-
uses: cssnr/mirror-repository-action@master
22+
uses: cssnr/mirror-repository-action@v1
2523
with:
2624
host: https://codeberg.org
2725
create: true

.github/workflows/release.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "Release"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
name: "Release"
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 5
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: "Update Tags"
17+
uses: cssnr/update-version-tags-action@v1

.github/workflows/tags.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
name: "Tags"
22

33
on:
4-
release:
5-
types: [published]
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Target Tag"
8+
required: true
69

710
jobs:
811
tags:
912
name: "Tags"
1013
runs-on: ubuntu-latest
1114
timeout-minutes: 5
15+
permissions:
16+
contents: write
1217

1318
steps:
1419
- name: "Update Tags"
1520
uses: cssnr/update-version-tags-action@v1
1621
with:
17-
token: ${{ secrets.GITHUB_TOKEN }}
22+
tag: ${{ inputs.tag }}
23+
token: ${{ secrets.GH_PAT }}

.github/workflows/test.yaml

+7-49
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: "Test"
22

33
on:
44
workflow_dispatch:
5-
pull_request:
5+
schedule:
6+
- cron: "18 18 * * 1,3,5"
67
push:
78
branches: [master]
9+
pull_request:
810

911
jobs:
1012
test:
@@ -28,52 +30,8 @@ jobs:
2830
json-key-value-check-action
2931
npx eslint src
3032
31-
lint:
32-
name: "Lint"
33-
runs-on: ubuntu-latest
34-
timeout-minutes: 5
35-
36-
steps:
37-
- name: "Checkout"
38-
uses: actions/checkout@v4
39-
40-
- name: "Setup Node"
41-
uses: actions/setup-node@v4
33+
- name: "Schedule Failure Notification"
34+
if: ${{ always() && failure() && github.event_name == 'schedule' }}
35+
uses: sarisia/actions-status-discord@v1
4236
with:
43-
node-version: 20
44-
45-
- name: "ESLint"
46-
run: |
47-
npm install
48-
npm run lint
49-
50-
build:
51-
name: "Build"
52-
runs-on: ubuntu-latest
53-
timeout-minutes: 5
54-
55-
steps:
56-
- name: "Checkout"
57-
uses: actions/checkout@v4
58-
59-
- name: "Setup Node"
60-
uses: actions/setup-node@v4
61-
with:
62-
node-version: 20
63-
64-
- name: "Build"
65-
run: |
66-
npm install
67-
npm run build
68-
69-
- name: "Verify"
70-
run: |
71-
git status --porcelain dist/
72-
if [ ! -d "dist" ];then
73-
echo "Missing dist directory, run: npm build"
74-
exit 1
75-
fi
76-
if [ -n "$(git status --porcelain dist)" ];then
77-
echo "Build was not run, run: npm build"
78-
exit 1
79-
fi
37+
webhook: ${{ secrets.DISCORD_WEBHOOK }}

.prettierignore

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# IDE
2+
.idea/
3+
.vscode/
4+
5+
# Tools
6+
.ruff_cache/
7+
.mypy_cache/
8+
.pytest_cache/
9+
10+
# Build
111
dist/
212
node_modules/
3-
package-lock.json

.prettierrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
},
1212
{
13-
"files": ["**/*.js", "**/*.css", "**/*.scss"],
13+
"files": ["**/*.js", "**/*.mjs", "**/*.ts", "**/*.css", "**/*.scss"],
1414
"options": {
1515
"tabWidth": 4
1616
}

README.md

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
[![Tags](https://img.shields.io/github/actions/workflow/status/cssnr/json-key-value-check-action/tags.yaml?logo=github&logoColor=white&label=tags)](https://github.com/cssnr/json-key-value-check-action/actions/workflows/tags.yaml)
1+
[![Release](https://img.shields.io/github/actions/workflow/status/cssnr/json-key-value-check-action/releaseyaml?logo=github&logoColor=white&label=release)](https://github.com/cssnr/json-key-value-check-action/actions/workflows/release.yaml)
22
[![Test](https://img.shields.io/github/actions/workflow/status/cssnr/json-key-value-check-action/test.yaml?logo=github&logoColor=white&label=test)](https://github.com/cssnr/json-key-value-check-action/actions/workflows/test.yaml)
3+
[![Lint](https://img.shields.io/github/actions/workflow/status/cssnr/json-key-value-check-action/lint.yaml?logo=github&logoColor=white&label=lint)](https://github.com/cssnr/json-key-value-check-action/actions/workflows/lint.yaml)
34
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=cssnr_json-key-value-check-action&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=cssnr_json-key-value-check-action)
45
[![GitHub Release Version](https://img.shields.io/github/v/release/cssnr/json-key-value-check-action?logo=github)](https://github.com/cssnr/json-key-value-check-action/releases/latest)
56
[![GitHub Last Commit](https://img.shields.io/github/last-commit/cssnr/json-key-value-check-action?logo=github&logoColor=white&label=updated)](https://github.com/cssnr/json-key-value-check-action/graphs/commit-activity)
@@ -18,18 +19,17 @@ Check that JSON Key's Values Match Provided Values.
1819
- [Contributing](#Contributing)
1920

2021
> [!NOTE]
21-
> Please submit
22-
> a [Feature Request](https://github.com/cssnr/json-key-value-check-action/discussions/categories/feature-requests)
22+
> Please submit a [Feature Request](https://github.com/cssnr/json-key-value-check-action/discussions/categories/feature-requests)
2323
> for new features or [Open an Issue](https://github.com/cssnr/json-key-value-check-action/issues) if you find any bugs.
2424
2525
## Inputs
2626

2727
| input | required | default | description |
28-
| --------- | -------- | ------- | ------------------------------ |
28+
| --------- | :------: | ------- | ------------------------------ |
2929
| file | **Yes** | - | JSON File Path to Validate |
3030
| keys | **Yes** | - | Keys to Check, One per Line |
3131
| values | **Yes** | - | Values to Verify, One per Line |
32-
| seperator | No | `.` | Nested Key Seperator |
32+
| seperator | - | `.` | Nested Key Seperator |
3333

3434
For multiple `keys` and `values` use new lines with a yaml `|`.
3535

@@ -83,22 +83,23 @@ If you are experiencing an issue/bug or getting unexpected results, you can:
8383
8484
- Report an Issue: https://github.com/cssnr/json-key-value-check-action/issues
8585
- Chat with us on Discord: https://discord.gg/wXy6m2X8wY
86-
- Provide General
87-
Feedback: [https://cssnr.github.io/feedback/](https://cssnr.github.io/feedback)
86+
- Provide General Feedback: [https://cssnr.github.io/feedback/](https://cssnr.github.io/feedback)
8887
8988
# Contributing
9089
9190
Currently, the best way to contribute to this project is to star this project on GitHub.
9291
9392
Additionally, you can support other GitHub Actions I have published:
9493
95-
- [VirusTotal Action](https://github.com/cssnr/virustotal-action)
96-
- [Update Version Tags Action](https://github.com/cssnr/update-version-tags-action)
97-
- [Update JSON Value Action](https://github.com/cssnr/update-json-value-action)
98-
- [Parse Issue Form Action](https://github.com/cssnr/parse-issue-form-action)
99-
- [Mirror Repository Action](https://github.com/cssnr/mirror-repository-action)
100-
- [Stack Deploy Action](https://github.com/cssnr/stack-deploy-action)
101-
- [Portainer Stack Deploy](https://github.com/cssnr/portainer-stack-deploy-action)
102-
- [Mozilla Addon Update Action](https://github.com/cssnr/mozilla-addon-update-action)
94+
- [Stack Deploy Action](https://github.com/cssnr/stack-deploy-action?tab=readme-ov-file#readme)
95+
- [Portainer Stack Deploy](https://github.com/cssnr/portainer-stack-deploy-action?tab=readme-ov-file#readme)
96+
- [VirusTotal Action](https://github.com/cssnr/virustotal-action?tab=readme-ov-file#readme)
97+
- [Mirror Repository Action](https://github.com/cssnr/mirror-repository-action?tab=readme-ov-file#readme)
98+
- [Update Version Tags Action](https://github.com/cssnr/update-version-tags-action?tab=readme-ov-file#readme)
99+
- [Update JSON Value Action](https://github.com/cssnr/update-json-value-action?tab=readme-ov-file#readme)
100+
- [Parse Issue Form Action](https://github.com/cssnr/parse-issue-form-action?tab=readme-ov-file#readme)
101+
- [Cloudflare Purge Cache Action](https://github.com/cssnr/cloudflare-purge-cache-action?tab=readme-ov-file#readme)
102+
- [Mozilla Addon Update Action](https://github.com/cssnr/mozilla-addon-update-action?tab=readme-ov-file#readme)
103+
- [Docker Tags Action](https://github.com/cssnr/docker-tags-action?tab=readme-ov-file#readme)
103104
104105
For a full list of current projects to support visit: [https://cssnr.github.io/](https://cssnr.github.io/)

0 commit comments

Comments
 (0)