Skip to content

Commit

Permalink
add validation action
Browse files Browse the repository at this point in the history
  • Loading branch information
Pronin-vk committed Jul 3, 2024
1 parent 94f9b0a commit f0d488e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 23 deletions.
9 changes: 9 additions & 0 deletions .github/actions/validation/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Validation'
description: It runs linter and prettier checks

runs:
using: composite
steps:
- name: Run linters
run: yarn lint:ci
shell: bash
22 changes: 0 additions & 22 deletions .github/workflows/checks.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
with:
version: ${{ github.event.inputs.new_version }}

- name: Validation
uses: ./.github/actions/validation

- name: Complete publish
uses: ./.github/actions/complete-publish
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
version: ${{ github.event.inputs.custom_version || github.event.inputs.new_version }}
npm_tag: ${{ github.event.inputs.npm_tag }}

- name: Validation
uses: ./.github/actions/validation

- name: Complete publish
uses: ./.github/actions/complete-publish
with:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Pull Request'

on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}

- name: Setting up the repository environment
uses: ./.github/actions/setup

- name: Validation
uses: ./.github/actions/validation
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"build": "tsc && esbuild src/vk-tunnel.ts --bundle --platform=node --target=node16.0 --outfile=bin/vk-tunnel.js",
"lint:eslint": "eslint ./src --ext=ts",
"lint:prettier": "prettier --check --ignore-unknown .",
"eslint:fix": "eslint ./src --ext=ts --fix",
"lint:ci": "yarn lint:eslint && yarn lint:prettier",
"lint:fix": "eslint ./src --ext=ts --fix",
"prepublishOnly": "yarn build"
},
"repository": {
Expand Down

0 comments on commit f0d488e

Please sign in to comment.