File: pull-request.yml

package info (click to toggle)
node-npm-package-arg 13.0.1%2B~6.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 480 kB
  • sloc: javascript: 1,935; makefile: 2
file content (53 lines) | stat: -rw-r--r-- 1,503 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This file is automatically added by @npmcli/template-oss. Do not edit.

name: Pull Request

on:
  pull_request:
    types:
      - opened
      - reopened
      - edited
      - synchronize

permissions:
  contents: read

jobs:
  commitlint:
    name: Lint Commits
    if: github.repository_owner == 'npm'
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Setup Git User
        run: |
          git config --global user.email "npm-cli+bot@github.com"
          git config --global user.name "npm CLI robot"
      - name: Setup Node
        uses: actions/setup-node@v4
        id: node
        with:
          node-version: 22.x
          check-latest: contains('22.x', '.x')
      - name: Install Latest npm
        uses: ./.github/actions/install-latest-npm
        with:
          node: ${{ steps.node.outputs.node-version }}
      - name: Install Dependencies
        run: npm i --ignore-scripts --no-audit --no-fund
      - name: Run Commitlint on Commits
        id: commit
        continue-on-error: true
        run: npx --offline commitlint -V --from 'origin/${{ github.base_ref }}' --to ${{ github.event.pull_request.head.sha }}
      - name: Run Commitlint on PR Title
        if: steps.commit.outcome == 'failure'
        env:
          PR_TITLE: ${{ github.event.pull_request.title }}
        run: echo "$PR_TITLE" | npx --offline commitlint -V