-
Notifications
You must be signed in to change notification settings - Fork 33
47 lines (40 loc) · 1.14 KB
/
update-submodules.yaml
File metadata and controls
47 lines (40 loc) · 1.14 KB
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
name: Update Submodules
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'
permissions:
actions: read
contents: write
jobs:
update:
if: ${{ github.repository_owner == 'CHTC' }}
runs-on: ubuntu-latest
outputs:
build: ${{ steps.update_submodules.outputs.build }}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
fetch-depth: 1
- name: Pull down submodules
id: update_submodules
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git submodule update --init --recursive --remote
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Update Article Submodule"
git push
echo "changes";
echo "build=true" >> $GITHUB_OUTPUT
else
echo "no changes";
echo "build=false" >> $GITHUB_OUTPUT
fi
build-updated-website:
needs: [update]
if: ${{ needs.update.outputs.build == 'true' }}
uses: ./.github/workflows/build.yml
secrets: inherit