1
0
mirror of synced 2025-12-30 03:01:36 -05:00

automatically close openapi PRs with no changes (#33532)

This commit is contained in:
Rachael Sewell
2022-12-13 17:24:06 -08:00
committed by GitHub
parent 23b8e6634d
commit 3dd5aafaca

View File

@@ -53,6 +53,21 @@ jobs:
- name: Decorate the dereferenced OpenAPI schemas
run: script/rest/update-files.js --decorate-only
- name: Check if pull request should be closed
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
echo "If there are no changes, exit"
NUM_FILES_CHANGED=$(git diff --name-only -- lib/rest/static/decorated | wc -l)
if [[ $NUM_FILES_CHANGED -eq 0 ]]
then
echo "No decorated file changes found"
gh pr comment "$PR_URL" --body "🤖 This pull request has no changes to lib/rest/static/decorated, so it is being closed automatically."
gh pr close "$PR_URL"
exit 0
fi
- name: Check in the decorated files
uses: EndBug/add-and-commit@050a66787244b10a4874a2a5f682130263edc192
with: