Skip to content

Update close-pull-requests.yml #37

Update close-pull-requests.yml

Update close-pull-requests.yml #37

name: Auto close pull requests
on:
pull_request_target:
types: [opened, labeled, unlabeled, reopened]
jobs:
auto_close:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

Check failure on line 12 in .github/workflows/close-pull-requests.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/close-pull-requests.yml

Invalid workflow file

You have an error in your yaml syntax on line 12
- name: Debug contains
echo: "The body of the pull request contains alfredodeza: ${{ contains(github.event.pull_request.body, 'alfredodeza') }} , and contains @alfredodeza: ${{ contains(github.event.pull_request.body, '@alfredodeza') }}
- name: Close PR if not pre-approved
if: |
${{ !(
contains(github.event.pull_request.labels.*.name, 'pre-approved')
||
contains(github.event.pull_request.body, 'alfredodeza')
) }}
run: |
MESSAGE="This repository doesn't accept pull requests. Please fork the repository and make changes there. If you really need this PR to be merged you must be an admin and label this pr with the 'pre-approved' label *or* tag Alfredo Deza (alfredodeza) to take a look."
gh pr close ${{ github.event.pull_request.number }} --repo education/codespaces-project-template-js --comment "$MESSAGE"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}