Skip to content

Commit

Permalink
ci: 🎡 update semantic_pr and caching error
Browse files Browse the repository at this point in the history
  • Loading branch information
yikoyu committed Oct 8, 2024
1 parent f1ede92 commit 28a4426
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
22 changes: 14 additions & 8 deletions .github/actions/build-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,28 @@ inputs:
runs:
using: composite
steps:
- uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js ${{ inputs.node-version }}
- name: Install Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: pnpm

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install
26 changes: 19 additions & 7 deletions .github/workflows/semantic_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,28 @@ on:
- synchronize

jobs:
check-semantic-commit:
name: Validate PR title
semantic-pr:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]

runs-on: ${{ matrix.os }}
node: [18]

steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- uses: ./.github/actions/build-setup
with:
node-version: ${{ matrix.node }}

- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: pnpm commitlint --from HEAD~1 --to HEAD --verbose

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request_target'
run: pnpm commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose

0 comments on commit 28a4426

Please sign in to comment.