forked from wagoid/commitlint-github-action
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (59 loc) · 2.18 KB
/
Copy pathcommitlint.yml
File metadata and controls
62 lines (59 loc) · 2.18 KB
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
54
55
56
57
58
59
60
61
62
name: Commitlint
on: [push, pull_request]
permissions: {}
jobs:
commitlint:
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Point action.yml at the local Dockerfile so this runs the code in the
# branch rather than a previously published image.
- run: sed -i -E "s/(docker:.+)/Dockerfile/" ./action.yml
- run: echo -n '' > .dockerignore
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24.19.0'
- uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
with:
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci --ignore-scripts
- uses: ./
id: run_commitlint
env:
NODE_PATH: ${{ github.workspace }}/node_modules
- name: Show results from JSON output
if: ${{ always() }}
env:
RESULTS: ${{ toJSON(steps.run_commitlint.outputs.results) }}
run: echo "$RESULTS"
# Runs the action as consumers do: no rewrite of action.yml, so this pulls
# the pinned digest from ghcr.io. Upstream's equivalent job pulled a version
# tag and so failed on every PR that bumped the version, before the image for
# it existed. A digest always refers to an image already published, so this
# is safe to run on every push and proves the digest reference resolves.
commitlint-from-published-image:
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24.19.0'
- run: npm ci --ignore-scripts
- uses: ./
env:
NODE_PATH: ${{ github.workspace }}/node_modules