Skip to content

Commit d31a0df

Browse files
authored
Merge branch 'main' into 2399-sdk-br
2 parents 3f5d0de + 5c71d69 commit d31a0df

11 files changed

Lines changed: 28 additions & 15 deletions

.github/scripts/cron-enforcer-pr-linked-issue.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
// A script to closes pull requests without a linked issue after 24 hours automatically.
1+
// A script to closes pull requests without a linked issue after 2 hours automatically.
22

33
// dryRun env var: any case-insensitive 'true' value will enable dry-run
44
const dryRun = (process.env.DRY_RUN || 'false').toString().toLowerCase() === 'true';
5-
const hoursBeforeClose = parseInt(process.env.HOURS_BEFORE_CLOSE || '24', 10);
5+
const immediateCheck =
6+
(process.env.IMMEDIATE_CHECK || 'false').toLowerCase() === 'true';
7+
const hoursBeforeClose = parseInt(process.env.HOURS_BEFORE_CLOSE || '2', 10);
68
const requireAuthorAssigned = (process.env.REQUIRE_AUTHOR_ASSIGNED || 'true').toLowerCase() === 'true';
79

810
const getHoursOpen = (pr) =>
@@ -88,6 +90,14 @@ async function closePR(github, pr, owner, repo, reason) {
8890
owner, repo, issue_number: pr.number,
8991
body: messages[reason]
9092
});
93+
94+
if (immediateCheck) {
95+
console.log(
96+
`✓ Commented on PR #${pr.number} (${reason}) link: ${pr.html_url}`
97+
);
98+
return;
99+
}
100+
91101
await github.rest.pulls.update({
92102
owner, repo, pull_number: pr.number, state: 'closed'
93103
});
@@ -119,8 +129,10 @@ module.exports = async ({ github, context }) => {
119129
}
120130

121131
const hours = getHoursOpen(pr);
122-
if (hours < hoursBeforeClose) {
123-
console.log(`PR #${pr.number} link: ${pr.html_url} is only ${hours} hours old. Skipping.`);
132+
if (!immediateCheck && hours < hoursBeforeClose) {
133+
console.log(
134+
`PR #${pr.number} link: ${pr.html_url} is only ${hours} hours old. Skipping.`
135+
);
124136
continue;
125137
}
126138

.github/workflows/archive/bot-pr-missing-linked-issue.yml renamed to .github/workflows/bot-pr-missing-linked-issue.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ jobs:
4040
- name: Checkout repository
4141
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
4242
with:
43-
ref: main
43+
ref: ${{ github.event.pull_request.base.sha || github.sha }}
4444

4545
- name: Check PR for missing linked issue
4646
env:
4747
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4848
DRY_RUN: ${{ github.event.inputs.dry_run || 'false' }}
4949
PR_NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
50+
IMMEDIATE_CHECK: "true"
5051
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
5152
with:
5253
script: |

.github/workflows/cron-enforcer-pr-linked-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
env:
3434
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3535
DRY_RUN: ${{ env.DRY_RUN }}
36-
HOURS_BEFORE_CLOSE: "24"
36+
HOURS_BEFORE_CLOSE: "2"
3737
REQUIRE_AUTHOR_ASSIGNED: "true"
3838
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
3939
with:

.github/workflows/pr-check-primary-codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
python-version: "3.11"
3838

3939
- name: Install uv
40-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
40+
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
4141

4242
- name: Install dependencies
4343
run: |

.github/workflows/pr-check-primary-codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757

5858
- name: Install uv
5959
if: matrix.language == 'python'
60-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
60+
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
6161
with:
6262
enable-cache: true
6363

.github/workflows/pr-check-secondary-deps-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
cache: "pip"
3939

4040
- name: Install uv
41-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
41+
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
4242

4343
- name: Create virtual environment
4444
run: uv venv

.github/workflows/pr-check-secondary-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
working-directory: .github/scripts
5959

6060
- name: Install uv
61-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
61+
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
6262

6363
- name: Install dependencies
6464
run: uv sync --frozen --all-groups --all-packages --all-extras

.github/workflows/pr-check-secondary-tck-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
python-version: "3.14"
4343

4444
- name: Install uv
45-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
45+
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
4646
with:
4747
enable-cache: true
4848

.github/workflows/pr-check-secondary-unit-integration-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
python-version: ${{ matrix.python-version }}
5555

5656
- name: Install uv
57-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
57+
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
5858
with:
5959
enable-cache: true
6060

@@ -117,7 +117,7 @@ jobs:
117117
python-version: ${{ matrix.python-version }}
118118

119119
- name: Install uv
120-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
120+
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
121121
with:
122122
enable-cache: true
123123

.github/workflows/test-scripts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
persist-credentials: false
3333

3434
- name: Install uv
35-
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
35+
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
3636

3737
- name: Install dependencies
3838
run: uv sync --frozen --all-groups --all-packages --all-extras

0 commit comments

Comments
 (0)