Skip to content

Commit

Permalink
Merge pull request #1 from codercops/workflow
Browse files Browse the repository at this point in the history
changed the commit
  • Loading branch information
anurag629 authored Aug 1, 2024
2 parents 45d3114 + 04745c3 commit 3b4298f
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/update-submodule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update Submodule in Codercops Site

on:
push:
branches:
- main # Change to your default branch name if it's different

jobs:
update-submodule:
runs-on: ubuntu-latest

steps:
- name: Checkout Codercops Site Repo
uses: actions/checkout@v3
with:
repository: your-username/codercops-site # Replace with your GitHub username and repo name
token: ${{ secrets.GIT_TOKEN }}
path: codercops-site

- name: Checkout Codercops Content Repo
uses: actions/checkout@v3
with:
path: codercops-content

- name: Get Latest Commit Hash
id: get_hash
run: |
cd codercops-content
echo "commit_hash=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Update Submodule
run: |
cd codercops-site
git submodule update --remote --merge
git add .
git commit -m "Update submodule to codercops-content commit ${{ env.commit_hash }}"
git push origin main # Change to your branch name if needed

0 comments on commit 3b4298f

Please sign in to comment.