Skip to content

Commit fcc1b97

Browse files
Fix YML issues; add YML validation (#3)
* Fix possible action problems * Add github workflow to validate yml file
1 parent 6f67928 commit fcc1b97

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.github/workflows/lint_yml.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint action.yml file
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Runs on any branch commit
7+
pull_request:
8+
branches:
9+
- '**' # Runs on any PR commit
10+
11+
jobs:
12+
run-script:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20.x'
23+
24+
- name: Install action-validator
25+
run: npm install -g @action-validator/core @action-validator/cli --save-dev
26+
27+
- name: Validate action.yml
28+
run: action-validator action.yml

action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,40 @@ runs:
1818
steps:
1919
- name: Set up NPM repository
2020
uses: actions/setup-node@v4
21+
shell: bash
2122
with:
2223
node-version: '20.x'
2324
registry-url: 'https://registry.npmjs.org'
2425

2526
- name: Set NPM package name
2627
uses: jaywcjlove/github-action-package@v2.0.0
28+
shell: bash
2729
with:
2830
rename: ${{ inputs.npm-package-name }}
2931

3032
- name: Publish to NPM
3133
env:
3234
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}
35+
shell: bash
3336
run: |
3437
npm publish
3538
3639
- name: Set up GitHub repository
3740
uses: actions/setup-node@v4
41+
shell: bash
3842
with:
3943
node-version: '20.x'
4044
registry-url: 'https://npm.pkg.github.com'
4145

4246
- name: Set GitHub package name
4347
uses: jaywcjlove/github-action-package@v2.0.0
48+
shell: bash
4449
with:
4550
rename: ${{ inputs.github-package-name }}
4651

4752
- name: Publish to GitHub Packages
4853
env:
4954
NODE_AUTH_TOKEN: ${{ inputs.github-token }}
55+
shell: bash
5056
run: |
5157
npm publish

0 commit comments

Comments
 (0)