Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create lint-job.yml #21

Merged
merged 3 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}