-
Notifications
You must be signed in to change notification settings - Fork 696
57 lines (50 loc) · 1.75 KB
/
BlockNewPullRequests.yml
File metadata and controls
57 lines (50 loc) · 1.75 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
name: Block New Pull Requests
on:
pull_request_target:
types: [opened]
branches: [main]
permissions:
contents: read
issues: write
pull-requests: write
jobs:
block-new-prs:
if: github.repository_owner == 'microsoft' && github.event.pull_request.state == 'open'
runs-on: ubuntu-latest
steps:
- name: Check PR creation date
id: check
shell: bash
run: |
created_at="${{ github.event.pull_request.created_at }}"
cutoff="2026-05-05T00:00:00Z"
if [[ "$created_at" > "$cutoff" ]]; then
echo "block=true" >> "$GITHUB_OUTPUT"
else
echo "block=false" >> "$GITHUB_OUTPUT"
fi
- name: Comment and close PR
if: steps.check.outputs.block == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const message = [
'👋 Thanks for your contribution!',
'',
'ALAppExtensions no longer accepts new pull requests.',
'',
'Extensibility requests, such as event requests and requests to make functions external, are still accepted as issues using the extensibility request template.',
'',
'We appreciate your understanding and look forward to continuing extensibility collaboration here 🙌'
].join('\n');
await github.rest.issues.createComment({
...context.repo,
issue_number: context.issue.number,
body: message
});
await github.rest.pulls.update({
...context.repo,
pull_number: context.issue.number,
state: 'closed'
});