-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.47 KB
/
Copy pathpull-request.yml
File metadata and controls
48 lines (46 loc) · 1.47 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
name: Pull request commit
on: pull_request
# the job runs code from the pull request
permissions:
contents: read
jobs:
commit-info:
name: commitInfo (${{ matrix.name }})
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include:
- name: default checkout
fetch-depth: 1
expected: head
- name: full clone
fetch-depth: 0
expected: head
- name: git 2.25
fetch-depth: 1
expected: head
container: mcr.microsoft.com/playwright:v1.28.1-focal
- name: fetch disabled
fetch-depth: 1
expected: checkout
disable-fetch: 'true'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: ${{ matrix.fetch-depth }}
- uses: actions/setup-node@v4
if: ${{ !matrix.container }}
with:
node-version: 16
# the checkout belongs to another user than the container's root
- if: ${{ matrix.container }}
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- run: git --version && node --version
- run: npm ci --ignore-scripts
- run: node .github/scripts/check-pull-request-commit.js
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
EXPECTED_COMMIT: ${{ matrix.expected }}
CURRENTS_DISABLE_HEAD_COMMIT_FETCH: ${{ matrix.disable-fetch }}