Skip to content

Commit

Permalink
Create lint-job.yml (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
VeiveHata authored Oct 2, 2024
1 parent 61d0fed commit 187ea6b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 27 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ on:
permissions:
contents: write
jobs:
run-linter-job:
uses: ./.github/workflows/lint-job.yml
if: github.event.pull_request.merged == true
with:
branch_name: ${{ github.head_ref }}
merge_pr:
name: 'Bump Version'
needs: run-linter-job
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -40,6 +46,3 @@ jobs:
run: pnpm version patch
- name: Git push version bump
run: git push origin main --follow-tags --force
- id: set-version
name: Output version change
run: pnpm pkg get version
36 changes: 36 additions & 0 deletions .github/workflows/lint-job.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on:
workflow_call:
inputs:
branch_name:
required: true
type: string

permissions:
checks: write
contents: write

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.12
cache: 'pnpm'

- name: Install Node.js dependencies
run: pnpm install

- name: Run linters
run: pnpm lint
28 changes: 4 additions & 24 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,7 @@ permissions:
contents: write

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.12
cache: 'pnpm'

- name: Install Node.js dependencies
run: pnpm install

- name: Run linters
run: pnpm lint
run-linter-job:
uses: ./.github/workflows/lint-job.yml
with:
branch_name: ${{ github.head_ref }}

0 comments on commit 187ea6b

Please sign in to comment.