refactor: replace magic number with GITHUB_ACTIONS_BOT_ID constant

- Create new constants file at src/github/constants.ts with GITHUB_ACTIONS_BOT_ID and GITHUB_ACTIONS_BOT_LOGIN
- Replace all occurrences of magic number 41898282 with the constant
- Update imports across source and test files to use the new constants
- Add comment in action.yml referencing the constants file for the default bot_id value

This improves code maintainability by centralizing the GitHub Actions bot ID definition.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
github-actions[bot]
2025-09-04 10:36:22 -07:00
parent 532c5e257d
commit 3fa4ea2174
8 changed files with 28 additions and 8 deletions

View File

@@ -2,6 +2,7 @@ import { describe, test, expect, beforeEach, afterEach, spyOn } from "bun:test";
import { prepareMcpConfig } from "../src/mcp/install-mcp-server";
import * as core from "@actions/core";
import type { ParsedGitHubContext } from "../src/github/context";
import { GITHUB_ACTIONS_BOT_ID } from "../src/github/constants";
describe("prepareMcpConfig", () => {
let consoleInfoSpy: any;
@@ -31,7 +32,7 @@ describe("prepareMcpConfig", () => {
branchPrefix: "",
useStickyComment: false,
useCommitSigning: false,
botId: "41898282",
botId: String(GITHUB_ACTIONS_BOT_ID),
allowedBots: "",
trackProgress: false,
},