Skip to content

Commit 6fc5c4e

Browse files
committed
adds a comment when auto rejecting
1 parent 4cd2561 commit 6fc5c4e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/validate-structure.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,25 @@ jobs:
5151
with:
5252
github-token: ${{ github.token }}
5353
script: |
54+
const pullNumber = context.payload.pull_request.number;
55+
const owner = context.repo.owner;
56+
const repo = context.repo.repo;
57+
58+
await github.rest.issues.createComment({
59+
owner,
60+
repo,
61+
issue_number: pullNumber,
62+
body: `Thank you for your contribution. However, it doesn't comply with our contributing guidelines. As a reminder, the general requirements (as outlined in the [CONTRIBUTING.md file](https://github.com/ServiceNowDevProgram/code-snippets/blob/main/CONTRIBUTING.md)) are the following: follow the folder+subfolder+snippetfolder guidelines and include a README.md file explaining what the code snippet does. Review your contribution against the guidelines and make the necessary adjustments. Closing this for now. Once you make additional changes, feel free to re-open this Pull Request or create a new one.`.trim()
63+
});
64+
5465
await github.rest.pulls.update({
55-
owner: context.repo.owner,
56-
repo: context.repo.repo,
57-
pull_number: context.payload.pull_request.number,
66+
owner,
67+
repo,
68+
pull_number: pullNumber,
5869
state: 'closed'
5970
});
6071
6172
- name: Mark job as failed if validation failed
6273
if: ${{ steps.validate.outcome == 'failure' }}
6374
run: exit 1
75+

0 commit comments

Comments
 (0)