Skip to content

Commit

Permalink
automatically close openapi PRs with no changes (github#33532)
Browse files Browse the repository at this point in the history
  • Loading branch information
rachmari authored Dec 14, 2022
1 parent 23b8e66 commit 3dd5aaf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/openapi-decorate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3dd5aaf

Please sign in to comment.