-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Xavier Metichecchia
authored and
Xavier Metichecchia
committed
Sep 5, 2024
1 parent
c84ff67
commit 73fc86e
Showing
1 changed file
with
6 additions
and
3 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 |
---|---|---|
|
@@ -11,23 +11,26 @@ jobs: | |
- name: Checkout repository without submodules | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: false # Do not checkout submodules | ||
submodules: false # Do not checkout submodules initially | ||
fetch-depth: 0 # Necessary to fetch all history for branch creation | ||
|
||
- name: Make PR Branch | ||
run: | | ||
git checkout -b update-submodule-hash-${{ github.run_id }} | ||
- name: Initialize and update submodule | ||
run: | | ||
git submodule update --init --recursive usagov-2021 | ||
- name: Update submodule to latest commit | ||
run: | | ||
cd usagov-2021/ | ||
git config --global user.name "Hash Pipeline" | ||
git config --global user.email "[email protected]" | ||
git fetch | ||
latest_commit=$(git rev-parse origin/main) # Get latest commit hash of the submodule | ||
git config -f .gitmodules submodule.usagov-2021.branch main | ||
git checkout $latest_commit | ||
cd .. | ||
git submodule update --remote usagov-2021 | ||
git add usagov-2021 | ||
git commit -m "Updated submodule to latest commit $latest_commit" | ||
git push origin HEAD:update-submodule-${{ github.run_id }} | ||
|