automatically close openapi PRs with no changes (#33532)
This commit is contained in:
15
.github/workflows/openapi-decorate.yml
vendored
15
.github/workflows/openapi-decorate.yml
vendored
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user