-
Notifications
You must be signed in to change notification settings - Fork 140
69 lines (55 loc) · 2.02 KB
/
PR.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Workflow to rebuild Spoons automatically
name: PR
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
paths:
- '**.lua'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Only run this if we're on the official repo. This prevents forks from getting super confusing with commits. If you want to host you own Spoon repository, consider re-enabling this, but for your repo.
if: github.repository == 'Hammerspoon/Spoons'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Check-out the Spoons PR
- uses: actions/checkout@v4
# Check-out the Hammerspoon repository we need for doc building
- uses: actions/checkout@v4
with:
repository: 'Hammerspoon/hammerspoon'
path: 'hammerspoon'
# Install doc-building dependencies
- name: Install docs dependencies
run: |
cd $GITHUB_WORKSPACE/hammerspoon
/usr/bin/python3 -m pip install -r requirements.txt
# Find files modified by this PR
- uses: lots0logs/gh-action-get-changed-files@2.2.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Show modified files, as a debug log
- name: Show changed files
run: cat $HOME/files.json
# Lint docstrings
- name: Docstrings Linter
run: ./gh_actions_doclint.sh
# Fail CI run if docstrings failed
- name: Check for docstring lint failures
run: ./gh_actions_doclint.sh -v
# Update docs and zips
- name: Update docs and zips
run: ./gh_actions_publish.sh
# Push changes
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name == 'push'