chore: refactor GitHub token retrieval to use core.getInput for improved action compatibility

This commit is contained in:
Luke Hagar
2025-08-15 09:08:56 -05:00
parent 34b9aa8350
commit 6b9f72594b

View File

@@ -5,6 +5,7 @@
import { Octokit } from '@octokit/rest';
import { graphql } from '@octokit/graphql';
import type { MetricResult } from './types.js';
import * as core from '@actions/core';
const PlatformSettings = {
name: 'GitHub',
@@ -158,7 +159,7 @@ interface GraphQLReleasesResponse {
}
// Initialize Octokit for REST API calls
const token = process.env.GITHUB_TOKEN || process.env.INPUT_GITHUB_TOKEN || '';
const token = core.getInput('github-token');
const octokit = new Octokit({
auth: token,
userAgent: 'usage-statistics-tracker'