apify-test-tools 0.10.2-beta.14 → 0.10.2-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/public_stale-issues.yaml +51 -0
- package/CHANGELOG.md +1 -0
- package/CONTRIBUTING.md +1 -1
- package/README.md +1 -1
- package/docs/workflows.md +39 -0
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: Close stale issues
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
inputs:
|
|
6
|
+
stale-months:
|
|
7
|
+
description: Months without activity before warning issue owners (one month = 30 days). Issues close 30 days after the warning.
|
|
8
|
+
type: number
|
|
9
|
+
default: 6
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
staleIssues:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
timeout-minutes: 30
|
|
15
|
+
permissions:
|
|
16
|
+
issues: write
|
|
17
|
+
concurrency:
|
|
18
|
+
group: stale-issues-${{ github.repository }}
|
|
19
|
+
cancel-in-progress: false
|
|
20
|
+
steps:
|
|
21
|
+
- name: Convert months to days
|
|
22
|
+
id: threshold
|
|
23
|
+
uses: actions/github-script@v9
|
|
24
|
+
env:
|
|
25
|
+
STALE_MONTHS: ${{ inputs.stale-months }}
|
|
26
|
+
with:
|
|
27
|
+
script: |
|
|
28
|
+
const months = Number(process.env.STALE_MONTHS);
|
|
29
|
+
if (!Number.isSafeInteger(months) || months < 1 || !Number.isSafeInteger(months * 30)) {
|
|
30
|
+
throw new Error('stale-months must be a positive whole number whose day count is a safe integer.');
|
|
31
|
+
}
|
|
32
|
+
if (months > 12) {
|
|
33
|
+
throw new Error('stale-months must be less than or equal to 12.');
|
|
34
|
+
}
|
|
35
|
+
return months * 30;
|
|
36
|
+
|
|
37
|
+
- name: Warn and close stale issues
|
|
38
|
+
uses: actions/stale@v11
|
|
39
|
+
with:
|
|
40
|
+
days-before-issue-stale: ${{ steps.threshold.outputs.result }}
|
|
41
|
+
days-before-issue-close: 30
|
|
42
|
+
days-before-pr-stale: ${{ steps.threshold.outputs.result }}
|
|
43
|
+
days-before-pr-close: 30
|
|
44
|
+
stale-issue-label: stale
|
|
45
|
+
stale-issue-message: >-
|
|
46
|
+
This issue has had no activity for ${{ inputs.stale-months }} month(s).
|
|
47
|
+
It will be closed as not planned in 30 days unless it is updated or commented on.
|
|
48
|
+
close-issue-message: Closed as not planned after 30 days without activity following the stale warning.
|
|
49
|
+
close-issue-reason: not_planned
|
|
50
|
+
remove-stale-when-updated: true
|
|
51
|
+
operations-per-run: 1000
|
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
|
|
|
16
16
|
- Support flexible secret passing methods in workflows ([#225](https://github.com/apify/apify-test-tools/pull/225)) ([22f7e80](https://github.com/apify/apify-test-tools/commit/22f7e807ca3949656c15b79f848a192d71b15946)) by [@metalwarrior665](https://github.com/metalwarrior665), closes [#205](https://github.com/apify/apify-test-tools/issues/205)
|
|
17
17
|
- [**breaking**] Require env vars of test versions in sync with the default version ([#217](https://github.com/apify/apify-test-tools/pull/217)) ([a2481dd](https://github.com/apify/apify-test-tools/commit/a2481ddf09004308cb54e49b783c8b21a25dcbe4)) by [@metalwarrior665](https://github.com/metalwarrior665)
|
|
18
18
|
- Add impact & priority assessment to claude investigator ([#216](https://github.com/apify/apify-test-tools/pull/216)) ([fd16622](https://github.com/apify/apify-test-tools/commit/fd16622b910ec6e9b5515ea0bd26b0a41c22bd23)) by [@foxt451](https://github.com/foxt451), closes [#208](https://github.com/apify/apify-test-tools/issues/208)
|
|
19
|
+
- Stale issue/pr workflow ([#236](https://github.com/apify/apify-test-tools/pull/236)) ([aff1fa7](https://github.com/apify/apify-test-tools/commit/aff1fa778adb846a60fdacdd26aa13a71729613d)) by [@JuanGalilea](https://github.com/JuanGalilea), closes [#35](https://github.com/apify/apify-test-tools/issues/35)
|
|
19
20
|
|
|
20
21
|
### 🐛 Bug Fixes
|
|
21
22
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -73,7 +73,7 @@ You need to run `npm run build` inside `apify-test-tools` repo everytime you wan
|
|
|
73
73
|
## Reusable workflows
|
|
74
74
|
|
|
75
75
|
The `public_`-prefixed workflows are the ones consumer repos call: `public_pr-build-test`,
|
|
76
|
-
`public_platform-tests`, `public_push-build-latest`, `public_claude`, `public_review` and
|
|
76
|
+
`public_platform-tests`, `public_push-build-latest`, `public_claude`, `public_review`, `public_stale-issues` and
|
|
77
77
|
`public_platform-tests-claude-investigate-and-fix`. They live here because they call this package's
|
|
78
78
|
CLI, so a change to both is one PR. GitHub only reads workflow files at the top level of
|
|
79
79
|
`.github/workflows`, so they sit next to this repo's own CI, and the prefix is what separates the
|
package/README.md
CHANGED
|
@@ -210,7 +210,7 @@ The workflows take every change straight to production, with tests in between:
|
|
|
210
210
|
These are GitHub Actions workflows. On another CI platform, build the same flow with the [CLI](docs/cli.md).
|
|
211
211
|
|
|
212
212
|
Add these files to `.github/workflows` in your repo. They call the reusable workflows in this repo, pinned at the
|
|
213
|
-
`@workflows-v0` major tag — never at `@master`. Every input, the optional Claude workflows, and how the tag moves are
|
|
213
|
+
`@workflows-v0` major tag — never at `@master`. Every input, the optional Claude workflows, stale issue closer, and how the tag moves are
|
|
214
214
|
in the [Workflow API](docs/workflows.md).
|
|
215
215
|
|
|
216
216
|
### `pr-build-devel-test.yaml`
|
package/docs/workflows.md
CHANGED
|
@@ -26,6 +26,7 @@ The build, release and test workflows below list the CLI commands they run.
|
|
|
26
26
|
| [`public_platform-tests.yaml`](#public_platform-testsyaml) | `schedule` | Runs platform tests against the released builds and reports results to Slack |
|
|
27
27
|
| [`public_review.yaml`](#public_reviewyaml) | `pull_request` (labeled) | Claude reviews the PR against the shared guidelines |
|
|
28
28
|
| [`public_claude.yaml`](#public_claudeyaml) | issue and PR comments, issue labels | Claude acts on `@claude` mentions |
|
|
29
|
+
| [`public_stale-issues.yaml`](#public_stale-issuesyaml) | `schedule` | Warns owners of inactive issues, then closes them a month later |
|
|
29
30
|
| [`public_platform-tests-claude-investigate-and-fix.yaml`](#public_platform-tests-claude-investigate-and-fixyaml) | after a failed platform test job | Claude investigates a failing platform test, opens an issue, and tries to fix it |
|
|
30
31
|
|
|
31
32
|
All of them run on `ubuntu-latest` with Node.js 24. The ones that need the repo's dependencies install them with
|
|
@@ -298,6 +299,44 @@ jobs:
|
|
|
298
299
|
TESTER_APIFY_TOKEN: ${{ secrets.TESTER_APIFY_TOKEN }}
|
|
299
300
|
```
|
|
300
301
|
|
|
302
|
+
## `public_stale-issues.yaml`
|
|
303
|
+
|
|
304
|
+
Optional. Wraps [`actions/stale`](https://github.com/actions/stale) to warn on inactive GitHub issues, then close them
|
|
305
|
+
as **not planned** 30 days later if still inactive. Locked issues are skipped. Pull requests use the same stale and
|
|
306
|
+
close thresholds, with the `Stale` label and no warning or closing comments.
|
|
307
|
+
|
|
308
|
+
| Input | Type | Default | Description |
|
|
309
|
+
| -------------- | ------ | ------- | -------------------------------------------------------------------- |
|
|
310
|
+
| `stale-months` | number | `6` | Optional whole number of inactive months (1–12); one month = 30 days |
|
|
311
|
+
|
|
312
|
+
```yaml
|
|
313
|
+
name: Close stale issues
|
|
314
|
+
|
|
315
|
+
on:
|
|
316
|
+
schedule:
|
|
317
|
+
- cron: '0 3 * * *'
|
|
318
|
+
workflow_dispatch:
|
|
319
|
+
|
|
320
|
+
jobs:
|
|
321
|
+
staleIssues:
|
|
322
|
+
permissions:
|
|
323
|
+
issues: write
|
|
324
|
+
uses: apify/apify-test-tools/.github/workflows/public_stale-issues.yaml@workflows-v0
|
|
325
|
+
with:
|
|
326
|
+
stale-months: 6
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
With `stale-months: 6`, an issue is labeled `stale` and warned after 180 days without activity, then closed after
|
|
330
|
+
another 30 inactive days. Existing older issues also get the full 30-day warning when adopting the workflow.
|
|
331
|
+
Actions happen on a scheduled run after the threshold; large backlogs are processed over successive runs.
|
|
332
|
+
|
|
333
|
+
The warning comment uses [GitHub's normal issue notifications](https://docs.github.com/en/subscriptions-and-notifications/reference/inbox-filters),
|
|
334
|
+
including notifications for assigned issues, subject to each user's notification settings. It does not add explicit
|
|
335
|
+
@mentions. Subsequent activity causes `actions/stale` to remove the stale label and restart the inactivity period.
|
|
336
|
+
|
|
337
|
+
The caller must grant `issues: write` as shown above. The workflow uses the automatic `GITHUB_TOKEN`; no additional
|
|
338
|
+
secrets, checkout, project dependencies, or Apify configuration are needed.
|
|
339
|
+
|
|
301
340
|
## Secrets
|
|
302
341
|
|
|
303
342
|
The workflows take two kinds of secrets:
|