feat: update API specifications #45
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Autoclose PRs | ||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'asyncapi.yml' | ||
| - 'openapi.yml' | ||
| jobs: | ||
| autoclose: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/github-script@v6 | ||
| with: | ||
| github-token: ${{secrets.GITHUB_TOKEN}} | ||
| script | | ||
| const creator = context.payload.sender.login; | ||
| const allowedUsers = ["deepgram-robot"]; | ||
| if (allowedUsers.includes(creator)) { | ||
| return; | ||
| } | ||
| core.setFailed("Invalid PR detected."); | ||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: "Thank you for opening this pull request.\n\nThis is a standard message notifying you that the API specification files should not be edited by a human. These are automatically generated through our various tooling." | ||
| }); | ||
| github.rest.pulls.update({ | ||
| owner: context.payload.repository.owner.login, | ||
| repo: context.payload.repository.name, | ||
| pull_number: context.payload.pull_request.number, | ||
| state: "closed" | ||
| }); | ||