-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Expand file tree
/
Copy paththird-party-library-changes.yml
More file actions
63 lines (53 loc) · 2.4 KB
/
third-party-library-changes.yml
File metadata and controls
63 lines (53 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Third Party Library Changes
on:
pull_request:
paths:
- 'src/wp-includes/ID3/**'
- 'src/wp-includes/IXR/**'
- 'src/wp-includes/PHPMailer/**'
- 'src/wp-includes/Requests/**'
- 'src/wp-includes/SimplePie/**'
- 'src/wp-includes/sodium_compat/**'
- 'src/wp-includes/Text/**'
# Disable permissions for all available scopes by default.
# Any needed permissions should be configured at the job level.
permissions: {}
jobs:
third-party-changed-files:
runs-on: ubuntu-latest
name: Get third party library modified files
permissions:
issues: write
pull-requests: write
if: ${{ github.repository == 'johnbillion/wordpress-develop' }}
steps:
- name: Leave a comment about third party libraries
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const { owner, repo } = context.repo;
const { number } = context.issue;
// Check for the presence of a comment and bail early.
const comments = ( await github.rest.issues.listComments( { owner, repo, issue_number: number } ) ).data;
const hasComment = comments.some( comment =>
comment.user.type === 'Bot' && comment.body.includes( 'Third Party Files' )
);
if ( hasComment ) return;
github.rest.issues.createComment( {
owner,
repo,
issue_number: number,
body: `## Third Party Files
This pull request modifies a third party library file. Changes to files in the following directories should be made to their respective upstream projects instead:
- \`src/wp-includes/ID3\`: [ID3](https://example.com)
- \`src/wp-includes/IXR\`: [IXR](https://example.com)
- \`src/wp-includes/PHPMailer\`: [PHPMailer](https://example.com)
- \`src/wp-includes/Requests\`: [Requests](https://example.com)
- \`src/wp-includes/SimplePie\`: [SimplePie](https://example.com)
- \`src/wp-includes/sodium_compat\`: [Sodium Compat](https://example.com)
- \`src/wp-includes/Text\`: [Text](https://example.com)
These changes need to be proposed and merged into the upstream projects before being included in WordPress.
`,
} );
- name: Fail the workflow run
run: exit 1