-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-scientific-research-submodule.yml
More file actions
40 lines (33 loc) · 1.15 KB
/
update-scientific-research-submodule.yml
File metadata and controls
40 lines (33 loc) · 1.15 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
name: Update Scientific-Research Submodule
on:
schedule:
# Runs at the start of every hour
- cron: '0 * * * *'
workflow_dispatch:
permissions:
contents: write
jobs:
update-submodule:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# Fetches all history for all tags and branches, including submodules
fetch-depth: 0
submodules: 'recursive'
- name: Configure git settings
run: |
git config --global pull.rebase false
git config --global user.email "breno.vicio78@gmail.com"
git config --global user.name "Breno Farias da Silva"
- name: Forcefully update Scientific-Research submodule to latest
run: |
cd Scientific-Research
git fetch origin main
git reset --hard origin/main
- name: Commit and push if changes are detected
run: |
git add Scientific-Research
git diff --cached --quiet || git commit -m "UPDATE: Automatically Updating the Scientific-Research SubModule to Latest Version."
git push || echo "No changes to push."