mirror of
https://github.com/astral-sh/ruff-action.git
synced 2026-05-22 06:40:47 +00:00
Do not expect GITHUB_TOKEN to be set or valid (#65)
Fixes: #49 Fixes: #63 This enables use of this action with GHES
This commit is contained in:
committed by
GitHub
parent
a634044659
commit
d8281c74d4
@@ -1,16 +1,20 @@
|
||||
import * as github from "@actions/github";
|
||||
import { Octokit } from "@octokit/core";
|
||||
import * as core from "@actions/core";
|
||||
import { paginateRest } from "@octokit/plugin-paginate-rest";
|
||||
import { restEndpointMethods } from "@octokit/plugin-rest-endpoint-methods";
|
||||
|
||||
import { OWNER, REPO } from "./utils/constants";
|
||||
import * as semver from "semver";
|
||||
|
||||
import { updateChecksums } from "./download/checksum/update-known-checksums";
|
||||
|
||||
const PaginatingOctokit = Octokit.plugin(paginateRest, restEndpointMethods);
|
||||
|
||||
async function run(): Promise<void> {
|
||||
const checksumFilePath = process.argv.slice(2)[0];
|
||||
const github_token = process.argv.slice(2)[1];
|
||||
|
||||
const octokit = github.getOctokit(github_token);
|
||||
const octokit = new PaginatingOctokit({ auth: github_token });
|
||||
|
||||
const response = await octokit.paginate(octokit.rest.repos.listReleases, {
|
||||
owner: OWNER,
|
||||
|
||||
Reference in New Issue
Block a user