Skip to content

[pull] main from fortran-lang:main #19

[pull] main from fortran-lang:main

[pull] main from fortran-lang:main #19

# Github action to cleanup a PR preview
# Runs when a pull request is merged or comment contains '#delete_preview'
#
name: PR Preview Cleanup
on:
issue_comment:
types: [created]
pull_request:
types:
- closed
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true || contains(github.event.comment.body, '#delete-preview')
steps:
# Checkout existing gh-pages branch into PUBLISH_DIR
- name: Checkout gh-pages
uses: actions/checkout@v4
with:
ref: gh-pages
# Cleanup preview files
- name: PR Cleanup
run: rm -rf pr/${{github.event.issue.number}}
- name: Commit and push to gh-pages
uses: EndBug/add-and-commit@v9.1.4
with:
message: "Sphinx build cleanup pr/${{github.event.issue.number}}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Comment on pull request
- name: Comment on pull request
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{github.event.issue.number}}
body: The preview build for this PR has now been deleted.