Compare commits

...

28 Commits

Author SHA1 Message Date
Shubham Tiwari 6ccc235c6d Update RELEASES.md 2022-03-25 11:52:13 +05:30
Shubham Tiwari 9d24b58739 Revert "reverting version update"
This reverts commit af84eba61e.
2022-03-25 11:51:01 +05:30
Shubham Tiwari af84eba61e reverting version update 2022-03-25 10:59:17 +05:30
Shubham Tiwari 385e1ed722 Merge branch 'enablingForGHES' of github.com:actions/toolkit into enablingForGHES 2022-03-25 00:51:58 +05:30
Shubham Tiwari 336e5e4ce8 remove extra spaces 2022-03-25 00:51:25 +05:30
Shubham Tiwari 299d3dd2ec Update RELEASES.md 2022-03-25 00:40:46 +05:30
Shubham Tiwari 8251d0edc0 push to start CI 2022-03-25 00:37:41 +05:30
Shubham Tiwari 2a53a08370 linting 2022-03-25 00:26:40 +05:30
Shubham Tiwari 6664f1646a linting 2022-03-25 00:25:03 +05:30
Shubham Tiwari ec8e458bdc merge conflicts 2022-03-25 00:06:54 +05:30
Shubham Tiwari 2487627b27 review comments 2022-03-25 00:02:17 +05:30
Shubham Tiwari 71b35793b1 Update packages/cache/src/internal/cacheUtils.ts
Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
2022-03-24 17:17:35 +05:30
Shubham Tiwari 4cb65fcdd9 update name to actions service 2022-03-24 13:36:58 +05:30
Shubham Tiwari 77a6cb490e lint 2022-03-24 12:37:32 +05:30
Shubham Tiwari a54ac04ab9 linting 2022-03-24 12:10:14 +05:30
Shubham Tiwari a4539ea36c lint 2022-03-24 11:55:57 +05:30
Shubham Tiwari 4e40c6dfc0 t pMerge branch 'enablingForGHES' of github.com:actions/toolkit into enablingForGHES 2022-03-24 11:46:21 +05:30
Shubham Tiwari 31035de89b Lint errors 2022-03-24 11:45:50 +05:30
Shubham Tiwari bc0e8f3536 Update RELEASES.md 2022-03-24 11:28:55 +05:30
Shubham Tiwari ba1126827e added test case 2022-03-24 11:26:30 +05:30
Shubham Tiwari a1a0cc7ebf Updated release 2022-03-24 09:01:37 +05:30
Shubham Tiwari d8025e51e1 Function rename 2022-03-24 09:00:25 +05:30
Shubham Tiwari 8fe3522c0b changed function name 2022-03-23 16:46:49 +05:30
Shubham Tiwari 05f407f4ff CI fix 2022-03-23 02:53:18 +05:30
Shubham Tiwari 429adbf862 Fix CI 2022-03-23 02:44:07 +05:30
Shubham Tiwari 3c38dcfe1f added ACTIONS_CACHE_URL in fixtures 2022-03-23 02:40:43 +05:30
Shubham Tiwari d87ca655a9 enablingForGHES 2022-03-23 02:25:34 +05:30
Shubham Tiwari 717b6fd18b Added support to check if Artifact cache service is enabled or not. 2022-03-23 02:24:43 +05:30
7 changed files with 33 additions and 11 deletions
+3
View File
@@ -53,3 +53,6 @@
### 1.0.11
- Fix file downloads > 2GB([issue](https://github.com/actions/cache/issues/773))
### 2.0.0
- Added support to check if Actions cache service feature is available or not [#1028](https://github.com/actions/toolkit/pull/1028)
+2 -2
View File
@@ -3,10 +3,10 @@
const fs = require('fs');
const os = require('os');
const filePath = process.env[`GITHUB_ENV`]
fs.appendFileSync(filePath, `ACTIONS_RUNTIME_URL=${process.env.ACTIONS_RUNTIME_URL}${os.EOL}`, {
fs.appendFileSync(filePath, `ACTIONS_RUNTIME_TOKEN=${process.env.ACTIONS_RUNTIME_TOKEN}${os.EOL}`, {
encoding: 'utf8'
})
fs.appendFileSync(filePath, `ACTIONS_RUNTIME_TOKEN=${process.env.ACTIONS_RUNTIME_TOKEN}${os.EOL}`, {
fs.appendFileSync(filePath, `ACTIONS_CACHE_URL=${process.env.ACTIONS_CACHE_URL}${os.EOL}`, {
encoding: 'utf8'
})
fs.appendFileSync(filePath, `GITHUB_RUN_ID=${process.env.GITHUB_RUN_ID}${os.EOL}`, {
+14
View File
@@ -0,0 +1,14 @@
import * as cache from '../src/cache'
test('isFeatureAvailable returns true if server url is set', () => {
try {
process.env['ACTIONS_CACHE_URL'] = 'http://cache.com'
expect(cache.isFeatureAvailable()).toBe(true)
} finally {
delete process.env['ACTIONS_CACHE_URL']
}
})
test('isFeatureAvailable returns false if server url is not set', () => {
expect(cache.isFeatureAvailable()).toBe(false)
})
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "@actions/cache",
"version": "1.0.11",
"version": "2.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@actions/cache",
"version": "1.0.11",
"version": "2.0.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.6",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@actions/cache",
"version": "1.0.11",
"version": "2.0.0",
"preview": true,
"description": "Actions cache lib",
"keywords": [
+10
View File
@@ -43,6 +43,16 @@ function checkKey(key: string): void {
}
}
/**
* isFeatureAvailable to check the presence of Actions cache service
*
* @returns boolean return true if Actions cache service feature is available, otherwise false
*/
export function isFeatureAvailable(): boolean {
return !!process.env['ACTIONS_CACHE_URL']
}
/**
* Restores cache from keys
*
+1 -6
View File
@@ -31,12 +31,7 @@ import {
const versionSalt = '1.0'
function getCacheApiUrl(resource: string): string {
// Ideally we just use ACTIONS_CACHE_URL
const baseUrl: string = (
process.env['ACTIONS_CACHE_URL'] ||
process.env['ACTIONS_RUNTIME_URL'] ||
''
).replace('pipelines', 'artifactcache')
const baseUrl: string = process.env['ACTIONS_CACHE_URL'] || ''
if (!baseUrl) {
throw new Error('Cache Service Url not found, unable to restore cache.')
}