mirror of
https://github.com/LukeHagar/usage-statistics.git
synced 2025-12-06 04:21:55 +00:00
chore: refactor GitHub token retrieval to use core.getInput for improved action compatibility
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user