Skip to content

Commit

Permalink
Merge from actions-subtree
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jul 1, 2024
1 parent 7a98fa5 commit 6a8a85c
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/push-on-change.yaml
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

0 comments on commit 6a8a85c

Please sign in to comment.