Skip to content

Commit

Permalink
feat: .github configs for git submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
jimbrig committed Jun 12, 2024
1 parent 84e2397 commit ca46ec9
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# No Clocks, LLC Default `dependabot.yml` Configuration File
version: 2
updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: ".github/workflows"
schedule:
interval: "daily"
# Git Submodules
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
58 changes: 58 additions & 0 deletions .github/workflows/git-submodules-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Git Sub-Modules Update

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
push:
branches:
- main
pull_request:
branches:
- main

jobs:
update:
name: Update Git SubModules
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TZ: America/New_York
if: contains(github.event.head_commit.message, '[skip ci]') == false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: recursive
- name: Setup Git
id: setup
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Update Submodules
id: update
run: |
git submodule update --remote --recursive
- name: Git Status
id: status
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "status<<$EOF" >> $GITHUB_OUTPUT
echo "$(git status -s)" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Stage and Commit
id: commit
if: ${{ steps.status.outputs.status }}
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
set +e
git add .
git commit -m "[chore]: update submodules at $(date "+DATE: %Y-%m-%d TIME: %H:%M:%S")"
- name: Push
if: ${{ steps.commit.outputs.status }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main

0 comments on commit ca46ec9

Please sign in to comment.