Update main.yml #15
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
name: Update Parent Repo | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
update_parent_repo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Configure Git | |
run: | | |
git config --global user.name "pieceowater" | |
git config --global user.email "pieceowater@gmail.com" | |
echo "${{ secrets.GIT_ASKPASS_SCRIPT }}" > ~/git-askpass.sh | |
chmod +x ~/git-askpass.sh | |
export GIT_ASKPASS=~/git-askpass.sh | |
git config --global credential.helper store | |
- name: Clone parent repo | |
run: | | |
git clone https://github.com/pieceowater/QPay.git parent_repo | |
- name: Update submodule in parent repo | |
run: | | |
cd parent_repo | |
git submodule update --init --recursive | |
git config --file .gitmodules submodule.QPay-backend.url "https://${{ secrets.GH_NAME }}:${{ secrets.GH_PAT }}@github.com/pieceowater/QPay-backend.git" | |
git submodule update --remote --recursive --init --quiet | |
- name: Add and commit submodule changes | |
run: | | |
cd parent_repo | |
git add . | |
git commit -m "${{ github.repository }}" | |
- name: Push changes to parent repo | |
run: | | |
cd parent_repo | |
git push origin main |