-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
57 lines (52 loc) · 1.82 KB
/
action.yaml
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
name: Label documentation only PRs.
author: Jakub Kuczys
description: >-
Label PRs based on whether they contain only documentation changes.
Supports file patterns and Python docstrings.
branding:
color: green
icon: book
runs:
using: composite
steps:
- name: Checkout the base branch for the pull request.
uses: actions/checkout@v3
- name: Checkout the merge branch for the open pull request.
if: github.event.pull_request.state == 'open'
run: |-
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/merge
git checkout -f FETCH_HEAD
shell: bash
- name: Checkout the merge branch for the closed (unmerged) pull request.
if: github.event.pull_request.state != 'open' && !github.event.pull_request.merged
run: |-
git fetch origin ${{ github.event.pull_request.merge_commit_sha }}
git checkout -f FETCH_HEAD
shell: bash
- name: Checkout the merge branch for the merged pull request.
if: github.event.pull_request.state != 'open' && github.event.pull_request.merged
run: |-
git fetch origin ${{ github.event.pull_request.head.sha }}
git checkout -f FETCH_HEAD
shell: bash
- name: Setup Python for the action.
id: python-for-action
uses: actions/setup-python@v4
with:
python-version: "3.11"
update-environment: false
- name: Run the action.
run: >-
pipx run
--python '${{ steps.python-for-action.outputs.python-path }}'
--spec '${{ github.action_path }}'
label-doconly-changes
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
LDC_BASE_REF: |-
${{
github.event.pull_request.merged
&& github.event.pull_request.base.sha
|| github.base_ref
}}