Skip to content

test notify-parent-repo.yml #40

test notify-parent-repo.yml

test notify-parent-repo.yml #40

name: Notify Parent Repo
on:
push:
branches:
- main
jobs:
update-parent:
runs-on: ubuntu-latest
steps:
- name: get secret name
run: echo "${{ secrets.PRIVATE_TOKEN }}"
- name: get secret value using secret name
run: echo "${{ vars.PARENT_ORG }} \ ${{ vars.PARENT_REPO }}"
- name: Checkout current repository
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ secrets.PRIVATE_TOKEN }}
- name: Checkout parent repository
uses: actions/checkout@v6
with:
repository: ${{ vars.PARENT_ORG }}/${{ vars.PARENT_REPO }}
token: ${{ secrets.PRIVATE_TOKEN }}
submodules: recursive
- name: Commit changes to parent repo
run: |
cp -r ./* ./${{ vars.PARENT_REPO }}/
cd ./${{ vars.PARENT_REPO }}
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add --all
git commit -m "Update submodules, triggered by ${GITHUB_REPOSITORY}" || echo "No changes to commit"
git push https://${{ secrets.PRIVATE_TOKEN }}@github.com/${{ vars.PARENT_ORG }}/${{ vars.PARENT_REPO }}.git main