-
Notifications
You must be signed in to change notification settings - Fork 78
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
Showing
1 changed file
with
47 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,47 @@ | ||
# DO NOT edit this file | ||
# Delete and create a new file with a different name instead | ||
on: | ||
push: | ||
branches: | ||
- '*/*' | ||
|
||
name: Push on change | ||
|
||
jobs: | ||
create_key: | ||
runs-on: ubuntu-18.04 | ||
|
||
name: Push on change | ||
|
||
steps: | ||
- name: Check out our repository | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git identity | ||
run: | | ||
git log HEAD^.. --pretty=format:"git config --global user.name '%an' && git config --global user.email '%ae'" | tee /dev/stderr | sh | ||
- name: Get branch name | ||
id: remote_repo | ||
run: | | ||
echo "::set-output name=slug::$(echo $GITHUB_REF | sed 's#refs/heads/##')" | ||
shell: bash | ||
|
||
- name: Check out remote repository | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ steps.remote_repo.outputs.slug }} | ||
path: remote/${{ steps.remote_repo.outputs.slug }} | ||
fetch-depth: 0 | ||
token: ${{ secrets.TOKEN_KEYS }} | ||
|
||
- name: Merge subtree | ||
run: | | ||
set -x | ||
cd remote/${{ steps.remote_repo.outputs.slug }} | ||
git subtree pull -m "Merge from actions-subtree" --prefix=.github/workflows ../../.. ${{ steps.remote_repo.outputs.slug }} | ||
git rm -rf .github/workflows/.github | ||
git commit --amend --no-edit || true | ||
git push |