Skip to content

Commit

Permalink
PXBF-dev: Init Submodule
Browse files Browse the repository at this point in the history
  • 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.
9 changes: 6 additions & 3 deletions .github/workflows/increment_sub_hash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 73fc86e

Please sign in to comment.