-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
38 lines (32 loc) · 1 KB
/
action.yml
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
# yamllint disable rule:line-length
---
name: 'Checkout PR'
description: >-
Checkout the exact number of PR commits + 1 (base_ref).
inputs:
jobname:
default: ${{ github.job }}
token:
description: 'A Github PAT'
runs:
using: "composite"
steps:
- name: 'PR commits + 1'
shell: bash
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits || 1 }} + 1 ))" >> "${GITHUB_ENV}"
- name: 'Checkout PR branch and all PR commits'
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ inputs.token }}
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
submodules: true
lfs: true
- name: 'Fetch the other branch with enough history for a common merge-base commit'
shell: bash
run: |
git fetch origin ${{ github.event.pull_request.base.sha || github.event.before }}
- name: 'Print git position'
shell: bash
run: |
git log -n ${{ env.PR_FETCH_DEPTH }} --oneline