mirror of
https://github.com/peakoss/anti-slop
synced 2026-12-01 13:39:13 +08:00
feat(tooling): add isLocal to run things conditionally
This commit is contained in:
2 files changed
+4
-3
No files matched your search
+2
-2
@@ -39,8 +39,8 @@ GITHUB_STEP_SUMMARY=tests/summary.html
|
|||||||
# Source branch of a pull_request or pull_request_target event (e.g. feature-branch-1)
|
# Source branch of a pull_request or pull_request_target event (e.g. feature-branch-1)
|
||||||
# GITHUB_HEAD_REF=
|
# GITHUB_HEAD_REF=
|
||||||
|
|
||||||
# Always true when GitHub Actions is running the workflow. Use this to differentiate local vs GitHub Actions runs.
|
# Always true when GitHub Actions is running the workflow. This is used to differentiate local vs GitHub Actions runs.
|
||||||
GITHUB_ACTIONS=true
|
GITHUB_ACTIONS=false
|
||||||
|
|
||||||
# Always true
|
# Always true
|
||||||
CI=true
|
CI=true
|
||||||
|
|||||||
+2
-1
@@ -2,9 +2,10 @@ import * as core from "@actions/core";
|
|||||||
import { getSettings } from "./settings.ts";
|
import { getSettings } from "./settings.ts";
|
||||||
import { buildContext } from "./context.ts";
|
import { buildContext } from "./context.ts";
|
||||||
import { checkExemptions } from "./exemptions.ts";
|
import { checkExemptions } from "./exemptions.ts";
|
||||||
|
|
||||||
export async function run(): Promise<void> {
|
export async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
|
const isLocal = !process.env["GITHUB_ACTIONS"];
|
||||||
|
|
||||||
const settings = getSettings();
|
const settings = getSettings();
|
||||||
|
|
||||||
const context = buildContext();
|
const context = buildContext();
|
||||||
|
|||||||
Reference in new issue
Block a user