diff --git a/.github/workflows/sync-repo-delete-branch.yml b/.github/workflows/sync-repo-delete-branch.yml new file mode 100644 index 0000000..49aa9c1 --- /dev/null +++ b/.github/workflows/sync-repo-delete-branch.yml @@ -0,0 +1,18 @@ +name: drupal.org sync + +on: [delete] + +jobs: + delete-branch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Delete Remote Branch + run: | + mkdir -p ~/.ssh + eval `ssh-agent -s` + ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" + git remote add drupal git@git.drupal.org:project/admin_ui.git + REMOTE_BRANCH=$(echo -n ${GITHUB_REF} | sed 's/refs\/heads\///g') + GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" + GIT_SSH_COMMAND=${GIT_SSH_COMMAND} git push drupal --delete ${REMOTE_BRANCH} || true diff --git a/.github/workflows/sync-repo-push-branch.yml b/.github/workflows/sync-repo-push-branch.yml new file mode 100644 index 0000000..71d0f16 --- /dev/null +++ b/.github/workflows/sync-repo-push-branch.yml @@ -0,0 +1,20 @@ +name: drupal.org sync + +on: [push] + +jobs: + push-branch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Push to remote branch + run: | + mkdir -p ~/.ssh + eval `ssh-agent -s` + ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}" + git remote add drupal git@git.drupal.org:project/admin_ui.git + REMOTE_BRANCH=$(echo -n ${GITHUB_REF} | sed 's/refs\/heads\///g') + GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no" + GIT_SSH_COMMAND=${GIT_SSH_COMMAND} git push drupal --delete ${REMOTE_BRANCH} || true + GIT_SSH_COMMAND=${GIT_SSH_COMMAND} git checkout -b local-branch + GIT_SSH_COMMAND=${GIT_SSH_COMMAND} git push drupal local-branch:${REMOTE_BRANCH}