Skip to content

test: add tea.yaml

test: add tea.yaml #8

Workflow file for this run

name: Close PRs with tea.yaml changes
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
close-pr:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0 # Necessary to fetch all history for all branches and tags
- name: Get list of changed files
id: files
uses: jitterbit/get-changed-files@v1
- name: Check for tea.yaml
id: check_for_tea
run: |
echo "changed files: ${{ steps.files.outputs.all }}"
if echo "${{ steps.files.outputs.all }}" | grep -q "tea.yaml"; then
echo "::set-output name=detected::true"
else
echo "::set-output name=detected::false"
fi
- name: Close PR if tea.yaml is changed
if: steps.check_for_tea.outputs.detected == 'true'
run: gh pr close --comment "This pull request has been automatically closed because it contains changes to `tea.yaml`, which is not allowed. Please contact the repository administrator for more information." --delete-branch "1"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}