Skip to content

Commit 0ce260e

Browse files
authored
Remove unnecessary non-ASCII characters from comments (#30)
1 parent 8f3152a commit 0ce260e

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎action/dist/index.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎action/dist/index.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎action/src/index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ const stepRegex = requireEnv("INPUT_STEP_REGEX");
3535

3636
const workerUrl = requireEnv("INPUT_WORKER_URL");
3737

38-
// ── Authentication ──────────────────────────────────────────────────────────
38+
// Authentication
3939
// Exchange a GitHub OIDC token for an installation access token via the
4040
// Cloudflare Worker. Requires id-token: write on the job.
4141

4242
const installationToken = await getInstallationTokenFromWorker(workerUrl);
4343
const octokit = new Octokit({ auth: installationToken });
4444
const gql = graphql.defaults({ headers: { authorization: `token ${installationToken}` } });
4545

46-
// ── Job log processing ──────────────────────────────────────────────────────
46+
// Job log processing
4747

4848
interface Row {
4949
url: string;
@@ -294,7 +294,7 @@ async function unminimizeIfHidden(nodeId: string): Promise<void> {
294294
);
295295
}
296296

297-
// ── Worker authentication helper ────────────────────────────────────────────
297+
// Worker authentication helper
298298

299299
async function getInstallationTokenFromWorker(workerUrl: string): Promise<string> {
300300
const tokenRequestUrl = process.env.ACTIONS_ID_TOKEN_REQUEST_URL;

‎worker/src/index.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
};
3939

4040
async function handleTokenRequest(request: Request, env: Env): Promise<Response> {
41-
// ── 1. Extract OIDC token ──────────────────────────────────────────────────
41+
// 1. Extract OIDC token
4242
const authHeader = request.headers.get("Authorization");
4343
if (!authHeader?.startsWith("Bearer ")) {
4444
return jsonError(
@@ -48,7 +48,7 @@ async function handleTokenRequest(request: Request, env: Env): Promise<Response>
4848
}
4949
const oidcToken = authHeader.slice("Bearer ".length);
5050

51-
// ── 2. Verify GitHub OIDC token ───────────────────────────────────────────
51+
// 2. Verify GitHub OIDC token
5252
// The expected audience is the URL of this worker itself.
5353
// The GitHub Action must request its OIDC token with this URL as the audience.
5454
const workerOrigin = new URL(request.url).origin;
@@ -70,7 +70,7 @@ async function handleTokenRequest(request: Request, env: Env): Promise<Response>
7070
const owner = repository.slice(0, slashIdx);
7171
const repo = repository.slice(slashIdx + 1);
7272

73-
// ── 3. Create GitHub App JWT ───────────────────────────────────────────────
73+
// 3. Create GitHub App JWT
7474
let appJwt: string;
7575
try {
7676
appJwt = await createAppJwt(env.GITHUB_APP_PRIVATE_KEY, env.GITHUB_APP_ID);
@@ -79,7 +79,7 @@ async function handleTokenRequest(request: Request, env: Env): Promise<Response>
7979
return jsonError("Internal error: failed to create App JWT", 500);
8080
}
8181

82-
// ── 4. Look up the App installation for this repository ───────────────────
82+
// 4. Look up the App installation for this repository
8383
let installationId: number;
8484
try {
8585
installationId = await getInstallationId(appJwt, owner, repo);
@@ -96,7 +96,7 @@ async function handleTokenRequest(request: Request, env: Env): Promise<Response>
9696
return jsonError("Failed to look up GitHub App installation", 500);
9797
}
9898

99-
// ── 5. Create an installation access token ────────────────────────────────
99+
// 5. Create an installation access token
100100
let tokenData: { token: string; expires_at: string };
101101
try {
102102
tokenData = await createInstallationToken(appJwt, installationId);
@@ -113,7 +113,7 @@ async function handleTokenRequest(request: Request, env: Env): Promise<Response>
113113
});
114114
}
115115

116-
// ── GitHub OIDC helpers ────────────────────────────────────────────────────────
116+
// GitHub OIDC helpers
117117

118118
/**
119119
* Verify a GitHub Actions OIDC JWT.
@@ -137,7 +137,7 @@ async function verifyGitHubOIDCToken(
137137
return payload as Record<string, unknown>;
138138
}
139139

140-
// ── GitHub App JWT helpers ─────────────────────────────────────────────────────
140+
// GitHub App JWT helpers
141141

142142
/**
143143
* Create a short-lived GitHub App JWT for authenticating App-level API calls.
@@ -215,7 +215,7 @@ async function createInstallationToken(
215215
return (await response.json()) as { token: string; expires_at: string };
216216
}
217217

218-
// ── Utility ────────────────────────────────────────────────────────────────────
218+
// Utility
219219

220220
function jsonError(message: string, status: number): Response {
221221
return Response.json({ error: message }, { status });

0 commit comments

Comments
 (0)