mirror of
				https://github.com/actions/cache.git
				synced 2025-11-04 13:29:10 +08:00 
			
		
		
		
	No-op on GHES
This commit is contained in:
		@@ -6,6 +6,12 @@ import * as utils from "./utils/actionUtils";
 | 
			
		||||
 | 
			
		||||
async function run(): Promise<void> {
 | 
			
		||||
    try {
 | 
			
		||||
        if (utils.isGhes()) {
 | 
			
		||||
            core.info("Cache action is not supported on GHES");
 | 
			
		||||
            utils.setCacheHitOutput(false);
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // Validate inputs, this can cause task failure
 | 
			
		||||
        if (!utils.isValidEvent()) {
 | 
			
		||||
            utils.logWarning(
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,11 @@ import * as utils from "./utils/actionUtils";
 | 
			
		||||
 | 
			
		||||
async function run(): Promise<void> {
 | 
			
		||||
    try {
 | 
			
		||||
        if (utils.isGhes()) {
 | 
			
		||||
            core.info("Cache action is not supported on GHES");
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!utils.isValidEvent()) {
 | 
			
		||||
            utils.logWarning(
 | 
			
		||||
                `Event Validation Error: The event type ${
 | 
			
		||||
 
 | 
			
		||||
@@ -2,6 +2,13 @@ import * as core from "@actions/core";
 | 
			
		||||
 | 
			
		||||
import { Outputs, RefKey, State } from "../constants";
 | 
			
		||||
 | 
			
		||||
export function isGhes(): boolean {
 | 
			
		||||
    const ghUrl = new URL(
 | 
			
		||||
        process.env["GITHUB_SERVER_URL"] || "https://github.com"
 | 
			
		||||
    );
 | 
			
		||||
    return ghUrl.hostname.toUpperCase() !== "GITHUB.COM";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function isExactKeyMatch(key: string, cacheKey?: string): boolean {
 | 
			
		||||
    return !!(
 | 
			
		||||
        cacheKey &&
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user