Skip to content

PRTarget with a branch and not a fork #214

PRTarget with a branch and not a fork

PRTarget with a branch and not a fork #214

name: PRs to Main
on:
pull_request:
branches: [feature/e2e-feedback-testing]
types: [closed]
jobs:
merge-master-back-to-dev:
if: github.event.pull_request.merged == false
timeout-minutes: 2
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: developer_branch
fetch-depth: 0
- name: Remove Updates from this PR
run: |
# Get Commits from this PR
TAG=PR_${{ github.event.pull_request.number }}
commits=$(git rev-list HEAD --grep=$TAG)
echo "commits: $commits"
# Revert Commits or Log that no change was made
git config --local user.email "dev@null"
git config --local user.name "Conformitron Bot"
for commit in $commits; do
echo $commit
git revert $commit --no-edit || echo "Commit $commit not reverted"
done
git push