Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretty #6

Merged
merged 2 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/update_submodules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'Update Submodule Action [Child]'
on:
repository_dispatch:
types: [update-submodules-famaf]
schedule:
- cron: '0 0 * * *'
- cron: '0 12 * * *'
# push:
# branches:
# - main
pull_request:
branches:
- main

env:
SHOULD_COMMIT: ''

jobs:
famaftestupdate:
name: Update submodules
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.WORKFLOW_TOKEN }}
submodules: recursive
- name: Update submodules
run: git submodule update --init --recursive --checkout -f --remote

- name: Update status
id: status
run: |
echo $(git status -s)
if [[ $(git status -s) ]]; then
export SHOULD_COMMIT=true
else
export SHOULD_COMMIT=false
fi
echo "SHOULD_COMMIT=$SHOULD_COMMIT" >> $GITHUB_ENV
echo "SHOULD_COMMIT=$SHOULD_COMMIT"

- name: Config git
if: ${{ env.SHOULD_COMMIT == 'true' }}
run: |
git config --global user.name "GitHub Action"
git config --global user.email "noreply@github.com"
source ./parentRepository/scripts/update_w_from_parent.sh
git add .github
git commit -am "[BOT] Update submodules at $(date "+DATE: %Y-%m-%d TIME: %H:%M:%S")"
git push
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Famaf-Resources-Manager"]
path = Famaf-Resources-Manager
url = git@github.com:FAMAF-resources/Famaf-Resources-Manager.git
1 change: 1 addition & 0 deletions Famaf-Resources-Manager
Loading