mirror of
				https://gitea.com/actions/cache.git
				synced 2025-11-02 07:47:08 +00:00 
			
		
		
		
	Merge branch 'main' into 700-actionscache-granular-cache-control
This commit is contained in:
		
							
								
								
									
										1
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							@@ -27,6 +27,7 @@ jobs:
 | 
			
		||||
        uses: actions/setup-node@v3
 | 
			
		||||
        with:
 | 
			
		||||
          node-version: 16.x
 | 
			
		||||
          cache: npm
 | 
			
		||||
      - name: Install dependencies
 | 
			
		||||
        run: npm ci
 | 
			
		||||
      - name: Rebuild the dist/ directory
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							@@ -25,17 +25,7 @@ jobs:
 | 
			
		||||
      uses: actions/setup-node@v3
 | 
			
		||||
      with:
 | 
			
		||||
        node-version: 16.x
 | 
			
		||||
    - name: Determine npm cache directory
 | 
			
		||||
      id: npm-cache
 | 
			
		||||
      run: |
 | 
			
		||||
        echo "::set-output name=dir::$(npm config get cache)"
 | 
			
		||||
    - name: Restore npm cache
 | 
			
		||||
      uses: actions/cache@v3
 | 
			
		||||
      with:
 | 
			
		||||
        path: ${{ steps.npm-cache.outputs.dir }}
 | 
			
		||||
        key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
 | 
			
		||||
        restore-keys: |
 | 
			
		||||
          ${{ runner.os }}-node-
 | 
			
		||||
        cache: npm
 | 
			
		||||
    - run: npm ci
 | 
			
		||||
    - name: Prettier Format Check
 | 
			
		||||
      run: npm run format-check
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							@@ -38485,17 +38485,16 @@ function getInputAsInt(name, options) {
 | 
			
		||||
}
 | 
			
		||||
exports.getInputAsInt = getInputAsInt;
 | 
			
		||||
function isCacheFeatureAvailable() {
 | 
			
		||||
    if (!cache.isFeatureAvailable()) {
 | 
			
		||||
        if (isGhes()) {
 | 
			
		||||
            logWarning(`Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.
 | 
			
		||||
    if (cache.isFeatureAvailable()) {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    if (isGhes()) {
 | 
			
		||||
        logWarning(`Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.
 | 
			
		||||
Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github Connect, please unretire the actions/cache namespace before upgrade (see https://docs.github.com/en/enterprise-server@3.5/admin/github-actions/managing-access-to-actions-from-githubcom/enabling-automatic-access-to-githubcom-actions-using-github-connect#automatic-retirement-of-namespaces-for-actions-accessed-on-githubcom)`);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
 | 
			
		||||
        }
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
    logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										15
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							@@ -38491,17 +38491,16 @@ function getInputAsInt(name, options) {
 | 
			
		||||
}
 | 
			
		||||
exports.getInputAsInt = getInputAsInt;
 | 
			
		||||
function isCacheFeatureAvailable() {
 | 
			
		||||
    if (!cache.isFeatureAvailable()) {
 | 
			
		||||
        if (isGhes()) {
 | 
			
		||||
            logWarning(`Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.
 | 
			
		||||
    if (cache.isFeatureAvailable()) {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
    if (isGhes()) {
 | 
			
		||||
        logWarning(`Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.
 | 
			
		||||
Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github Connect, please unretire the actions/cache namespace before upgrade (see https://docs.github.com/en/enterprise-server@3.5/admin/github-actions/managing-access-to-actions-from-githubcom/enabling-automatic-access-to-githubcom-actions-using-github-connect#automatic-retirement-of-namespaces-for-actions-accessed-on-githubcom)`);
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
 | 
			
		||||
        }
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
    return true;
 | 
			
		||||
    logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -77,19 +77,20 @@ export function getInputAsInt(
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function isCacheFeatureAvailable(): boolean {
 | 
			
		||||
    if (!cache.isFeatureAvailable()) {
 | 
			
		||||
        if (isGhes()) {
 | 
			
		||||
            logWarning(
 | 
			
		||||
                `Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.
 | 
			
		||||
    if (cache.isFeatureAvailable()) {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (isGhes()) {
 | 
			
		||||
        logWarning(
 | 
			
		||||
            `Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.
 | 
			
		||||
Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github Connect, please unretire the actions/cache namespace before upgrade (see https://docs.github.com/en/enterprise-server@3.5/admin/github-actions/managing-access-to-actions-from-githubcom/enabling-automatic-access-to-githubcom-actions-using-github-connect#automatic-retirement-of-namespaces-for-actions-accessed-on-githubcom)`
 | 
			
		||||
            );
 | 
			
		||||
        } else {
 | 
			
		||||
            logWarning(
 | 
			
		||||
                "An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions."
 | 
			
		||||
            );
 | 
			
		||||
        }
 | 
			
		||||
        );
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return true;
 | 
			
		||||
    logWarning(
 | 
			
		||||
        "An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions."
 | 
			
		||||
    );
 | 
			
		||||
    return false;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user