-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.92 KB
/
build-stubs.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
name: Build WordPress stubs
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
push:
branches:
- main
paths:
- 'fixtures.php'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-stubs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Setup SSH
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DEPLOYBOT_SSH_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOYBOT_SSH_PRIVATE_KEY }}
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: none
- name: Install dependencies
uses: ramsey/composer-install@v3
- name: Generate stubs
run: php generate.php
- name: Add, commit, and push
run: |
git config user.email ${{ secrets.DEPLOYBOT_EMAIL }}
git config user.name ${{ secrets.DEPLOYBOT_USER }}
git config --add safe.directory "${GITHUB_WORKSPACE}"
git add ./stubs/*
git add ./packages.json
git commit -m "Update WordPress stubs" || ((echo "NO_CHANGES=yes" >> $GITHUB_ENV) && (echo "No changes to commit"))
- name: Update reference and push
if: ${{ env.NO_CHANGES != 'yes' }}
run: |
php update_reference.php "$(git rev-parse HEAD)"
git add ./packages.json
git commit -m "Update packages.json references"
git push