mirror of
https://github.com/LukeHagar/usage-statistics.git
synced 2025-12-06 12:57:44 +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 { Octokit } from '@octokit/rest';
|
||||||
import { graphql } from '@octokit/graphql';
|
import { graphql } from '@octokit/graphql';
|
||||||
import type { MetricResult } from './types.js';
|
import type { MetricResult } from './types.js';
|
||||||
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
const PlatformSettings = {
|
const PlatformSettings = {
|
||||||
name: 'GitHub',
|
name: 'GitHub',
|
||||||
@@ -158,7 +159,7 @@ interface GraphQLReleasesResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Initialize Octokit for REST API calls
|
// 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({
|
const octokit = new Octokit({
|
||||||
auth: token,
|
auth: token,
|
||||||
userAgent: 'usage-statistics-tracker'
|
userAgent: 'usage-statistics-tracker'
|
||||||
|
|||||||
Reference in New Issue
Block a user