mirror of
https://github.com/peakoss/anti-slop
synced 2026-12-01 13:39:13 +08:00
feat(context): build context in main.ts
This commit is contained in:
2 files changed
+16
No files matched your search
@@ -0,0 +1,13 @@
|
|||||||
|
import * as github from "@actions/github";
|
||||||
|
import * as core from "@actions/core";
|
||||||
|
import type { Context } from "./types";
|
||||||
|
|
||||||
|
export function buildContext(): Context {
|
||||||
|
core.info("Building context from payload...");
|
||||||
|
|
||||||
|
const payload = github.context.payload;
|
||||||
|
|
||||||
|
core.debug(`Payload:\n${JSON.stringify(payload, null, 2)}`);
|
||||||
|
|
||||||
|
return {};
|
||||||
|
}
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import { getSettings } from "./settings.ts";
|
import { getSettings } from "./settings.ts";
|
||||||
|
import { buildContext } from "./context.ts";
|
||||||
|
|
||||||
export async function run(): Promise<void> {
|
export async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const settings = getSettings();
|
const settings = getSettings();
|
||||||
|
|
||||||
|
const context = buildContext();
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|||||||
Reference in new issue
Block a user