-
Notifications
You must be signed in to change notification settings - Fork 35
64 lines (57 loc) · 1.77 KB
/
submodule-sync.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
name: 'Submodule synchronization'
on:
push:
branches-ignore:
- 'main'
- 'master'
pull_request:
branches-ignore:
- 'main'
- 'master'
jobs:
submodule-sync:
runs-on: ubuntu-latest
steps:
- name: Extract branch name from GITHUB_REF
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2
env:
fail-fast: true
- name: Fetch tut
uses: actions/checkout@v4
with:
repository: 'the-events-calendar/tut'
ref: 'main'
path: 'tut'
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer Downloads
uses: actions/cache@v2
with:
path: vendor/
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
- name: Install tut dependencies
shell: bash
run: |
cd tut && composer install --no-dev --ignore-platform-reqs
- name: Create .env
shell: bash
run: |
cd tut && echo "GITHUB_USER=$GITHUB_USER" >> .env && echo "GITHUB_OAUTH_TOKEN=$GITHUB_OAUTH_TOKEN" >> .env
env:
GITHUB_USER: ${{ secrets.GH_BOT_USER }}
GITHUB_OAUTH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
- name: Synchronize submodules
shell: bash
run: |
cd tut && ./tut submodule-sync --branch=${{ steps.extract_branch.outputs.branch }}