-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from codercops/workflow
changed the commit
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |