Skip to content

Commit

Permalink
Merge pull request #181 from zetxek/add/update-submodule-workflow
Browse files Browse the repository at this point in the history
Add/update submodule workflow
  • Loading branch information
zetxek authored Jul 7, 2024
2 parents 3a8489f + 76549b8 commit f982e78
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

- package-ecosystem: gitsubmodule
schedule:
interval: "daily"
directory: /
40 changes: 40 additions & 0 deletions .github/workflows/update-submodules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update submodules (theme)

# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
# This workflow contains a single job called "update"
update:
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Pull & update submodules recursively
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Commit & push changes
run: |
DATE=$(date '+%Y%m%d-%H%M')
BRANCH_NAME="update-submodules/update-$DATE"
# Setup the committers identity.
git config user.email "[email protected]"
git config user.name "GitHub Actions - update theme submodule"
git checkout -b $BRANCH_NAME
git submodule update --init --recursive
git submodule update --recursive --remote
git commit -am "Update submodules"
git push origin $BRANCH_NAME
- name: create pull request
run: gh pr create -B main -H $BRANCH_NAME --title 'Update site submodules' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1 comment on commit f982e78

@vercel
Copy link

@vercel vercel bot commented on f982e78 Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.