name: remove-pr

on:
  pull_request:
    types: [closed]
jobs:
  remove-pr:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          repository: ${{ github.repository }}.wiki
      - name: Prune PR files
        run: |
          rm -rf ${{ github.head_ref }}
          git add .
          git status
          git commit -m "Prune ${{ github.head_ref }}"
          git push origin master
        env:
          GIT_AUTHOR_EMAIL: ${{ github.actor }}@users.noreply.github.com
          GIT_AUTHOR_NAME: ${{ github.actor }}
          GIT_COMMITTER_EMAIL: ${{ github.actor }}@users.noreply.github.com
          GIT_COMMITTER_NAME: ${{ github.actor }}

name: remove-pr

on:
  pull_request:
    types: [closed]
jobs:
  remove-pr:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          repository: ${{ github.repository }}.wiki
      - name: Prune PR files
        run: |
          rm -rf ${{ github.head_ref }}
          git add .
          git status
          git diff --staged --quiet && echo 'No changes to commit; exiting!' && exit 0
          git commit -m "Prune ${{ github.head_ref }}"
          git push origin master
        env:
          GIT_AUTHOR_EMAIL: ${{ github.actor }}@users.noreply.github.com
          GIT_AUTHOR_NAME: ${{ github.actor }}
          GIT_COMMITTER_EMAIL: ${{ github.actor }}@users.noreply.github.com
          GIT_COMMITTER_NAME: ${{ github.actor }}

Exit with success if no changes to commit.
Exit with success if no changes to commit.
