Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ Defaults to `false`.

Only capture the URL if the most recent existing capture is older than this value. Accepts SPN2 timedelta strings (e.g. `1d`, `3h 20m`) or plain seconds (e.g. `3600`). Supports a comma-separated pair (e.g. `1d,7d`) to apply a different value to outlinks.

### `delayBetweenRequests`

Time, in milliseconds, to wait between web requests. Use this to work with rate-limited hosting.

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs say “wait between web requests”, but the implementation delays only between top-level URL captures (and WayBack.save itself performs multiple requests/polls). Consider clarifying wording to avoid implying every internal request is delayed.

This issue also appears on line 80 of the same file.

Suggested change
Time, in milliseconds, to wait between web requests. Use this to work with rate-limited hosting.
Time, in milliseconds, to wait between capturing each input URL. Use this to work with rate-limited hosting.

Copilot uses AI. Check for mistakes.

## Outputs

### `wayback_url`
Expand Down
4 changes: 4 additions & 0 deletions src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ export default class Input {
readonly ifNotArchivedWithin = this.getInput('ifNotArchivedWithin', {
trimWhitespace: true,
});
readonly delayBetweenRequests;

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delayBetweenRequests is declared without a type, which becomes an implicit any under the repo's strict TS config (extends @tsconfig/strictest). Add an explicit type (e.g., number | null) so the project continues to typecheck cleanly.

Suggested change
readonly delayBetweenRequests;
readonly delayBetweenRequests: number | null;

Copilot uses AI. Check for mistakes.

constructor() {
const urls = this.getMultilineInput('url', {
required: false,
trimWhitespace: true,
});

const delayInput = this.getInput('delayBetweenRequests', { trimWhitespace: true });
this.delayBetweenRequests = delayInput ? Number(delayInput) : null;

Comment on lines +29 to +31

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds a new GitHub Action input, but action.yml currently does not declare delayBetweenRequests. Undeclared inputs are treated as unexpected by the runner and typically won’t be passed through, so this option may be unusable in real workflows until it’s added to the action metadata.

This issue also appears on line 29 of the same file.

Copilot uses AI. Check for mistakes.
this.url = urls.length > 0 ? urls : this.detectFromCname();
this.validate();
}
Expand Down
3 changes: 3 additions & 0 deletions src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export default async function run(): Promise<void> {
log.error(`Archive process failed for ${url}: ${err.message}`);
failures.push({ url, error: err });
}
if (input.delayBetweenRequests) {
await Promise.delay(input.delayBetweenRequests);
}
Comment on lines +29 to +31

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New behavior (delayBetweenRequests parsing + runner waiting between URLs) isn’t covered by tests. There are existing input/runner tests (Vitest), so please add coverage for: (1) valid delay parsing, (2) invalid delay rejecting with a helpful error, and (3) runner actually awaiting the delay (fake timers).

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +31

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promise.delay is not a standard API and this repo doesn't appear to include Bluebird (no existing Promise.delay usage/dependency). If a user sets delayBetweenRequests, this will throw at runtime. Use a real delay implementation (e.g., import { setTimeout as delay } from 'node:timers/promises' and await delay(ms)), or reuse a shared helper (similar to WayBack.sleep).

Copilot uses AI. Check for mistakes.
}

writeOutputs(results);
Expand Down
Loading