-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.11 KB
/
update-submodules.yml
File metadata and controls
39 lines (34 loc) · 1.11 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
name: Atualizar Submódulos
on:
push:
branches:
- main
schedule:
- cron: '0 3 * * *' # Executa diariamente às 3:00 UTC
workflow_dispatch: # Permite execução manual no GitHub
jobs:
update-submodules:
runs-on: ubuntu-latest
steps:
- name: Clonar repositório com submódulos
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.PERSONAL_TOKEN }}
- name: Configurar Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Atualizar submódulos para HEAD remoto
run: |
git submodule foreach '
echo "Atualizando $name...";
git fetch origin;
branch=$(git symbolic-ref --short HEAD || echo main);
git checkout origin/$branch;
'
- name: Commit e Push se necessário
run: |
git add .
git commit -m "Atualiza submódulos para HEAD remoto" || echo "Nenhuma mudança"
git push origin main