Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from actions:main #1

Open
wants to merge 763 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
763 commits
Select commit Hold shift + click to select a range
c366a07
Merge pull request #1672 from actions/attest-v1.0.0
bdehamer Feb 26, 2024
68b042f
fix permissions for release workflow
bdehamer Feb 26, 2024
29bf378
Merge pull request #1675 from actions/provenance-permissions
bdehamer Feb 26, 2024
b777057
flip releases order
bethanyj28 Feb 28, 2024
df3315b
Merge pull request #1676 from actions/bethanyj28/flip-releases
bethanyj28 Feb 28, 2024
ff435e5
Make sure RequestOptions.keepAlive is applied properly on node20 runt…
teatimeguest Feb 28, 2024
eea6b7f
Update RELEASES.md
bethanyj28 Feb 29, 2024
e918bf2
Update RELEASES.md
bethanyj28 Feb 29, 2024
0c735ba
Merge pull request #1677 from actions/bethanyj28/update-releases
bethanyj28 Feb 29, 2024
bb420e4
add info level logging for zip extract
bethanyj28 Mar 1, 2024
4799020
bump version
bethanyj28 Mar 1, 2024
55c7a1e
Merge pull request #1678 from actions/bethanyj28/logging
bethanyj28 Mar 1, 2024
b807fc9
Update http-client to 2.2.1 (#1679)
luketomlinson Mar 1, 2024
8fee77b
fix #1579: add test to check getCacheVersion does not mutate arguments
Smeb Nov 27, 2023
ef77c9d
Merge pull request #1683 from Smeb/fix-1579
bethanyj28 Mar 7, 2024
a0e6af1
build provenance stmt from OIDC claims
bdehamer Mar 22, 2024
4ce4c76
npm audit fix
bdehamer Mar 22, 2024
59e9d28
Merge pull request #1693 from actions/bdehamer/oidc-provenance
bdehamer Mar 28, 2024
f8d95a8
generate v0.3 bundles in attest package
bdehamer Apr 3, 2024
9ddf153
Merge pull request #1701 from actions/bdehamer/attest-v03-bundle
bdehamer Apr 3, 2024
2e7a11c
upgrading archiver package along with chunk timeout
vmjoseph Apr 9, 2024
7f0a981
Revert http
vmjoseph Apr 9, 2024
f98ccd1
updating tests
vmjoseph Apr 9, 2024
61d6acd
updating test
vmjoseph Apr 9, 2024
4fc93ec
.
vmjoseph Apr 9, 2024
2ed9516
updating timeout
vmjoseph Apr 9, 2024
98ce947
updating timeout
vmjoseph Apr 9, 2024
0d3d3bb
Adding missing progress time
vmjoseph Apr 9, 2024
90fca23
replacing timeout
vmjoseph Apr 9, 2024
425f05e
moving timer outside of uploadZipToBlobStorage
vmjoseph Apr 9, 2024
18a8a22
updating upload try catch to always call cleartimeout
vmjoseph Apr 9, 2024
fa9db3c
wrapping timeout in try catch
vmjoseph Apr 9, 2024
2227330
.
vmjoseph Apr 9, 2024
c01bc90
fixing https://github.com/advisories/GHSA-f5x3-32g6-xq36
eggyhead Apr 10, 2024
df5a794
fixing new-package script instruction
eggyhead Apr 10, 2024
4fb4c6e
Merge branch 'eggyhead/fix-tar-ddos-vuln' into vmjoseph/update-archiver
vmjoseph Apr 12, 2024
c104cf5
Merge pull request #1713 from actions/eggyhead/fix-tar-ddos-vuln
eggyhead Apr 12, 2024
67951b1
Merge branch 'main' into vmjoseph/update-archiver
vmjoseph Apr 15, 2024
5d943d4
Rever http
vmjoseph Apr 15, 2024
be50742
.
vmjoseph Apr 15, 2024
75b5e53
updating artifact version
vmjoseph Apr 15, 2024
5eea9e3
cleaning up comments and removing clear timeout outside of finaly
vmjoseph Apr 15, 2024
fa06a1e
removing minor ver for now
vmjoseph Apr 15, 2024
2bbbf92
re-adding minor ver for now
vmjoseph Apr 15, 2024
e998cf1
cleaning up tests
vmjoseph Apr 15, 2024
fa1cb5d
correcting imports
vmjoseph Apr 15, 2024
234761d
replacing writeFile with writeFileSync
vmjoseph Apr 15, 2024
918b468
replacing writeFile with writeFileSync
vmjoseph Apr 15, 2024
5a73664
Merge pull request #1712 from actions/vmjoseph/update-archiver
eggyhead Apr 15, 2024
ccb1df4
artifact client: retry on non-JSON response
robherley Apr 19, 2024
b384fe1
bump pkg version + release notes
robherley Apr 19, 2024
eb1cb36
Merge pull request #1721 from actions/robherley/retry-502-invalid-body
robherley Apr 19, 2024
2961d73
remove dep on make-fetch-happen
bdehamer Apr 10, 2024
d82fd09
Merge pull request #1714 from actions/bdehamer/attest-no-make-fetch-h…
bdehamer Apr 23, 2024
476276b
use latest unzip-stream
bethanyj28 Apr 23, 2024
0159bbe
bump version
bethanyj28 Apr 23, 2024
6e642f6
lint
bethanyj28 Apr 23, 2024
9eb3d3a
lint
bethanyj28 Apr 23, 2024
29885a8
Merge pull request #1724 from actions/bethanyj28/update-unzip-stream
bethanyj28 Apr 24, 2024
0e8fe8a
retry request on failure to save attestation
bdehamer Apr 24, 2024
81a73ab
Merge pull request #1725 from actions/bdehamer/attest-retry-persist
bdehamer Apr 25, 2024
abb586d
add doc link in @actions/attest readme
bdehamer May 1, 2024
ae38557
Merge pull request #1730 from actions/bdehamer/attest-readme
bdehamer May 1, 2024
e606940
Read the server url from the environment variable.
kommendorkapten May 16, 2024
7d18e7a
PR feedback. Juse more JS idiomatic code
kommendorkapten May 20, 2024
d3d7736
Fixed a spelling error
kommendorkapten May 20, 2024
d1df13e
Merge pull request #1735 from kommendorkapten/dynamic-urls
kommendorkapten May 21, 2024
8735a7e
prep 1.3.0 release of @actions/attest
bdehamer May 21, 2024
32dbccb
Add debug message
Link- May 23, 2024
264230c
add debug
Link- May 23, 2024
c8466d1
Add twirp client
Link- May 29, 2024
c6b4871
Merge pull request #1738 from actions/bdehamer/attest-1.3.0
bdehamer Jun 5, 2024
73100a7
new GHA build provenance
bdehamer Jun 5, 2024
66d5434
Add v2 cache upload
Link- Jun 10, 2024
dccc3f7
Fix upload mechanics
Link- Jun 10, 2024
6635d12
Implement cache v2
Link- Jun 10, 2024
146143a
Implement cache v2
Link- Jun 10, 2024
9e63a77
Implement cache v2
Link- Jun 10, 2024
08d6f14
Merge pull request #1745 from actions/bdehamer/attest-provenance
bdehamer Jun 12, 2024
dddc440
config rekor to fetch on conflict
bdehamer Jun 12, 2024
361a115
Merge pull request #1759 from actions/bdehamer/rekor-409
bdehamer Jun 12, 2024
5e5faf7
Use zlib for compression
Link- Jun 13, 2024
5afc042
Add download cache v2
Link- Jun 17, 2024
8d7ed4f
Fix cache service url bug
Link- Jun 17, 2024
7640cf1
Fix cache misses
Link- Jun 17, 2024
e1b7e78
Fix cache misses
Link- Jun 17, 2024
04d1a7e
Add fix cache paths
Link- Jun 17, 2024
4902d3a
Add backend ids
Link- Jun 24, 2024
176b40a
allow localhost hostnames for artifact checks
robherley Jul 3, 2024
5683269
npm audit fix
robherley Jul 3, 2024
1db7362
Merge pull request #1768 from actions/robherley/artifacts-allow-local…
robherley Jul 3, 2024
182702d
fix chunk timeout + update tests
robherley Jul 24, 2024
3e34f6d
add comment for chunk timeout
robherley Jul 24, 2024
49927e4
Merge pull request #1774 from actions/robherley/fix-chunk-timeout
robherley Jul 25, 2024
9517cdf
Prevent "too many open files" in artifact upload
rmunn Jul 23, 2024
b28406b
fix proxy support for jwks retrieval
bdehamer Jul 26, 2024
7c61054
Remove unused import
rmunn Jul 27, 2024
90d9783
Merge pull request #1776 from actions/bdehamer/jwks-proxy-fix
bdehamer Jul 29, 2024
7463cf3
Merge pull request #1771 from rmunn/fix-too-many-open-files
robherley Jul 31, 2024
58d14c4
prep for @actions/artifact v2.1.9
robherley Jul 31, 2024
76b6e24
bump pkg lock
robherley Jul 31, 2024
bb6c500
Merge pull request #1781 from actions/robherley/artifact-2.1.9
robherley Aug 1, 2024
3a33cca
FIX: Set chunk timeout back to 5 minutes
SMoraisAnsys Aug 6, 2024
f003268
Merge pull request #1786 from SMoraisAnsys/fix/chunk-timeout
robherley Aug 6, 2024
48a6537
Fix HTTP client tests (#1792)
thboop Aug 15, 2024
50f2977
Add glob option to ignore hidden files (#1791)
joshmgross Aug 15, 2024
340a103
support for headers param in attest functions
bdehamer Aug 14, 2024
279e891
Merge pull request #1790 from actions/bdehamer/attest-headers
bdehamer Aug 16, 2024
1b9927d
Handle Encoded URL for Proxy Username and Password in HTTP Client (#1…
yangy-23 Aug 16, 2024
f299e8b
HTTP Client 2.2.2 Release (#1794)
thboop Aug 16, 2024
fa6cc53
derive default OIDC issuer from current tenant
bdehamer Aug 16, 2024
7cc96bb
Merge pull request #1796 from actions/bdehamer/attest-issuer
bdehamer Aug 16, 2024
ac3a063
improve release notes for @actions/attest
bdehamer Aug 16, 2024
faf9cb2
Include the package name in the Publish Workflow run (#1793)
joshmgross Aug 16, 2024
ada9e00
fix encoding for proxy auth token
bdehamer Aug 16, 2024
571d782
Merge pull request #1797 from actions/bdehamer/attester-release-notes
bdehamer Aug 19, 2024
7298ff3
Merge pull request #1799 from actions/bdehamer/http-client-proxy-auth
bdehamer Aug 21, 2024
d1aa255
HTTP Client 2.2.3 Release (#1804)
thboop Aug 22, 2024
1e69bff
bump @actions/http-client from 2.2.1 to 2.2.3
bdehamer Aug 22, 2024
6c4e082
Merge pull request #1805 from actions/bdehamer/update-http-client
bdehamer Aug 22, 2024
b7a914b
Use native `crypto` package from node
mydea Aug 30, 2024
2e1998f
update lockfile
mydea Aug 30, 2024
2a07de1
fix bug with customized oidc issuer
bdehamer Sep 4, 2024
6dd369c
Merge pull request #1823 from actions/bdehamer/enterprise-issuer
bdehamer Sep 5, 2024
7f19a78
fix regression, auto readlink on symlinks again
robherley Sep 20, 2024
d6694e4
update release notes
robherley Sep 20, 2024
8551843
fix assertion
robherley Sep 20, 2024
5a62022
/
robherley Sep 20, 2024
70e5684
Merge branch 'main' into neo-cache-service
Link- Sep 24, 2024
07e51a4
Add cache service v2 client
Link- Sep 24, 2024
e62c642
Fix service urls
Link- Sep 24, 2024
2a8f1c5
bump package lock version
robherley Oct 1, 2024
78af634
Remove dependency on `uuid` package (#1824)
joshmgross Oct 2, 2024
650f7c6
Merge pull request #1830 from actions/robherley/artifact-2.1.10
robherley Oct 2, 2024
6ca0d9b
Release `@actions/core v1.11.0` (#1839)
joshmgross Oct 2, 2024
22a72ac
Include #1551 in `@actions/core` 1.11.0 release notes (#1840)
joshmgross Oct 2, 2024
d14afd7
Explicitly import `crypto` (#1842)
joshmgross Oct 4, 2024
c18a7d2
Merge pull request #1815 from mydea/fn/remove-crypto
JoannaaKL Oct 7, 2024
545e0e6
properly resolve relative symlinks
robherley Oct 8, 2024
49cbbbc
Update symlink bug fix reference number
robherley Oct 8, 2024
201b082
Merge pull request #1844 from actions/robherley/artifact-2.1.11
robherley Oct 8, 2024
799f8f5
Update artifact release notes
robherley Oct 8, 2024
ee93b05
Merge pull request #1845 from actions/robherley/update-release-notes
robherley Oct 8, 2024
13abc95
Port restoreCache to new service
Link- Oct 9, 2024
4d1dedf
Merge branch 'main' into neo-cache-service
Link- Oct 9, 2024
c6c5ef6
bump @sigstore/sign from 2.3.2 to 3.0.0
bdehamer Oct 14, 2024
ac1332a
bump @actions/core from 1.10.1 to 1.11.1
bdehamer Oct 14, 2024
26c752f
prep release of @actions/attest v1.5.0
bdehamer Oct 14, 2024
7b4d976
Merge pull request #1846 from actions/bdehamer/sigstore-3-0-0
bdehamer Oct 14, 2024
72113fe
Merge pull request #1847 from actions/bdehamer/attest-update-core
bdehamer Oct 14, 2024
29d342f
Merge pull request #1848 from actions/bdehamer/attest-prep-1-5
bdehamer Oct 14, 2024
d399e33
Merge branch 'main' into neo-cache-service
Link- Oct 21, 2024
89354f6
Cleanup implementation and use tarballs instead of streaming zip
Link- Oct 21, 2024
7f5921c
Document unreleased changes in `cache` and `tool-cache` (#1856)
joshmgross Oct 22, 2024
28dbd8f
Cleanups and package refactoring
Link- Oct 24, 2024
01bf918
Refactoring & cleanup
Link- Oct 24, 2024
717ba9d
Handle tags containing "@" character in `buildSLSAProvenancePredicate`
meriadec Oct 30, 2024
65ee4d3
use macos-latest-large in test/release workflows (#1869)
bdehamer Nov 1, 2024
265a5be
support multi-subject attestations
bdehamer Oct 30, 2024
43ce96d
Merge pull request #1865 from actions/bdehamer/multi-subject
bdehamer Nov 1, 2024
339447c
Merge pull request #1863 from meriadec/attest-provenance-tags
bdehamer Nov 1, 2024
7e54468
update release notes for @actions/attest v1.5.0
bdehamer Nov 1, 2024
d13839f
Merge pull request #1870 from actions/bdehamer/attest-1.5-release-notes
bdehamer Nov 1, 2024
77f247b
Prepare `@actions/cache` 3.3.0 release (#1871)
joshmgross Nov 1, 2024
bb2278e
Extend Node version test coverage (#1843)
joshmgross Nov 8, 2024
75cdb2c
Merge branch 'main' into neo-cache-service
Link- Nov 14, 2024
9da70ff
Post merge cleanup
Link- Nov 14, 2024
4e1912a
Restore __tests__
Link- Nov 14, 2024
d109d9c
Handle ACTIONS_CACHE_SERVICE_V2 feature flag
Link- Nov 14, 2024
9dff82c
Port dependencies & remove dependency on toolkit/artifacts
Link- Nov 14, 2024
69409b3
Fix broken test
Link- Nov 14, 2024
b2557ac
Formatting and stylistic cleanup
Link- Nov 14, 2024
19cdd5f
Linter cleanups
Link- Nov 14, 2024
83baffc
Package upgrades with security fixes
Link- Nov 14, 2024
2ee77e6
Add missing function return types
Link- Nov 14, 2024
c3e354d
Remove unnecessary debug information
Link- Nov 14, 2024
ea4bf48
Remove unnecessary debug information
Link- Nov 14, 2024
5e9ef85
Lint fixes
Link- Nov 14, 2024
ab8110f
Remove unecessary packages from top level package.json
Link- Nov 14, 2024
555b03f
Revert package.json
Link- Nov 14, 2024
68ab87c
Add check to make sure archive has been created already
Link- Nov 14, 2024
6c11d44
Remove unnecessary type hints
Link- Nov 14, 2024
3ca8547
Merge branch 'neo-cache-service' of github.com:actions/toolkit into n…
Link- Nov 14, 2024
8616c31
Remove unused definitions
Link- Nov 14, 2024
a1e6ef3
Update cache service APIs & cleanup
Link- Nov 20, 2024
ab58a59
Bump cross-spawn to 7.0.6
Link- Nov 20, 2024
267841d
Add isGhes gate and refactor to clean up circular dependencies
Link- Nov 21, 2024
e2028d4
Linter fixes and remove unnecessary dependency
Link- Nov 21, 2024
39d1981
Add restore tests
Link- Nov 22, 2024
20ed290
Merge pull request #1857 from actions/neo-cache-service
Link- Nov 22, 2024
27dfd2c
Merge branch 'main' into add-restore-tests
Link- Nov 22, 2024
4de30f7
Add more tests for restoreCacheV2
Link- Nov 25, 2024
54ac2dd
Add cache service version debug message
Link- Nov 25, 2024
4dadd61
Add support for matching on restore key values
Link- Nov 25, 2024
de236da
Fix cache lookup scenario
Link- Nov 25, 2024
2d25139
Remove unused package
Link- Nov 25, 2024
0e321b2
Add the download cache file status code to debug log
Link- Nov 25, 2024
4d31e10
Add the download cache file status code to debug log
Link- Nov 25, 2024
35ede8f
Add a new debug message for downloads
Link- Nov 25, 2024
928d3e8
Merge pull request #1876 from actions/add-restore-tests
Link- Nov 25, 2024
8f60668
Add saveCacheV2 tests
johnsudol Nov 24, 2024
1f08749
Add debug message for uploadResponse
johnsudol Nov 26, 2024
46174ed
run prettier
johnsudol Nov 26, 2024
208dbe2
PR feedback
johnsudol Nov 26, 2024
94f18eb
Only mock the cacheUtil methods we need
johnsudol Nov 26, 2024
5d0a4af
Remove unused mock
johnsudol Nov 26, 2024
b050504
Add test case for when the uploadFile fails on the blobclient
johnsudol Nov 27, 2024
27e5cf2
Replace downloadCacheFile with downloadCacheStorageSDK
Link- Nov 27, 2024
af3981c
Update the useragent of the old http client to pass cache version
Link- Nov 27, 2024
35d87ab
Refactor code formatting for consistency and readability
Link- Nov 27, 2024
9cc30cb
Add `saveCacheV2` tests (#1879)
johnsudol Nov 27, 2024
3a128c8
Merge branch 'main' into enhance-blob-client
Link- Nov 27, 2024
c5a5de0
Delete download-cache
Link- Nov 28, 2024
df16670
Refactor cache upload functionality and improve test cases
Link- Nov 28, 2024
c1fb081
Linter fixes
Link- Nov 28, 2024
eaf0083
Respect download options for restore
Link- Nov 28, 2024
62f5f18
Refactor saveCacheV2 to use saveCache from cacheHttpClient
Link- Nov 28, 2024
8c5f6f2
Force use of Azure for restoreCacheV2
Link- Nov 28, 2024
65892d5
Fine tune blob uploads
Link- Nov 29, 2024
1d403c2
Fix tests
Link- Nov 29, 2024
c6f1224
Add progress tracking for blob uploads
Link- Dec 2, 2024
ee1c07d
Add error handling for failed uploads
Link- Dec 2, 2024
4a272e9
Troubleshoot
Link- Dec 2, 2024
db1d013
Troubleshoot
Link- Dec 2, 2024
d89855b
Fix upload progress bug
Link- Dec 2, 2024
a762876
Minor refactoring
Link- Dec 2, 2024
87171e2
Fix tests
Link- Dec 2, 2024
7ad18fd
Fix linter complaints
Link- Dec 2, 2024
792ec71
Tune upload options
Link- Dec 2, 2024
b24632b
Fix comments
Link- Dec 2, 2024
3f7df8e
Fix comments
Link- Dec 2, 2024
502e8ce
Minor comment adjustments
Link- Dec 2, 2024
fb40492
Merge branch 'enhance-blob-client' of github.com:actions/toolkit into…
Link- Dec 2, 2024
c649df4
Minor comment adjustments
Link- Dec 2, 2024
c02c929
Minor comment adjustments
Link- Dec 2, 2024
a10e209
Merge pull request #1882 from actions/enhance-blob-client
Link- Dec 2, 2024
4498687
Prepare @actions/cache 4.0.0 release
Link- Dec 3, 2024
cb001af
Update README to include deprecation notice
Link- Dec 3, 2024
59845ec
Update deprecation notice
Link- Dec 4, 2024
72447df
Update deprecation notice
Link- Dec 4, 2024
cd9197e
Add announcement link
Link- Dec 4, 2024
0827eef
Rerun CI
Link- Dec 4, 2024
b7a00a3
Merge pull request #1886 from actions/Link-/cache-4.0.0
Link- Dec 4, 2024
1e0c16f
return artifact digest on upload
bdehamer Dec 6, 2024
f522fdf
Merge pull request #1896 from actions/bdehamer/artifact-digest
bdehamer Dec 17, 2024
4426b4e
Prepare artifact release 2.2.0
bdehamer Dec 17, 2024
433f760
Merge pull request #1908 from actions/bdehamer/artifact-2.2.0
bdehamer Dec 17, 2024
26f8f84
Remove unused cache API (#1907)
joshmgross Dec 17, 2024
01f21ba
Remove more unused cache APIs
joshmgross Dec 17, 2024
adb9c4a
Remove more unused cache APIs (#1909)
joshmgross Dec 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
packages/*/node_modules/
packages/*/lib/
packages/glob/__tests__/_temp
packages/glob/__tests__/_temp
packages/*/src/generated/*/
53 changes: 45 additions & 8 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,64 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/recommended"],
"plugins": [
"jest",
"@typescript-eslint",
"prettier"
],
"extends": [
"plugin:github/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.eslint.json"
},
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"eslint-comments/no-use": "off",
"no-constant-condition": ["error", { "checkLoops": false }],
"github/no-then": "off",
"import/no-namespace": "off",
"no-shadow": "off",
"no-unused-vars": "off",
"i18n-text/no-en": "off",
"filenames/match-regex": "off",
"import/no-commonjs": "off",
"import/named": "off",
"no-sequences": "off",
"import/no-unresolved": "off",
"no-undef": "off",
"no-only-tests/no-only-tests": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"accessibility": "no-public"
}
],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"@typescript-eslint/func-call-spacing": [
"error",
"never"
],
"@typescript-eslint/naming-convention": [
"error",
{
Expand Down Expand Up @@ -56,15 +90,18 @@
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/semi": [
"error",
"never"
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
},
"ignorePatterns": "packages/glob/__tests__/_temp/**/",
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}
}
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Note that before a PR will be accepted, you must ensure:

### Useful Scripts

- `npm run bootstrap` This runs `lerna bootstrap` which will install dependencies in this repository's packages and cross-link packages where necessary.
- `npm run bootstrap` This runs `lerna exec -- npm install` which will install dependencies in this repository's packages and cross-link packages where necessary.
- `npm run build` This compiles TypeScript code in each package (this is especially important if one package relies on changes in another when you're running tests). This is just an alias for `lerna run tsc`.
- `npm run format` This checks that formatting has been applied with Prettier.
- `npm test` This runs all Jest tests in all packages in this repository.
Expand All @@ -43,7 +43,7 @@ Note that before a PR will be accepted, you must ensure:
1. In a new branch, create a new Lerna package:

```console
$ npm run create-package new-package
$ npm run new-package [name]
```

This will ask you some questions about the new package. Start with `0.0.0` as the first version (look generally at some of the other packages for how the package.json is structured).
Expand Down
201 changes: 150 additions & 51 deletions .github/workflows/artifact-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
- '**.md'

jobs:
build:
name: Build
upload:
name: Upload

strategy:
matrix:
Expand All @@ -22,17 +22,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set Node.js 12.x
uses: actions/setup-node@v1
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 12.x

# In order to upload & download artifacts from a shell script, certain env variables need to be set that are only available in the
# node context. This runs a local action that gets and sets the necessary env variables that are needed
- name: Set env variables
uses: ./packages/artifact/__tests__/ci-test-action/
node-version: 20.x

# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
# without these to just compile the artifacts package
Expand All @@ -45,51 +40,155 @@ jobs:
npm run tsc
working-directory: packages/artifact

- name: Set artifact file contents
shell: bash
run: |
echo "non-gzip-artifact-content=hello" >> $GITHUB_ENV
echo "gzip-artifact-content=Some large amount of text that has a compression ratio that is greater than 100%. If greater than 100%, gzip is used to upload the file" >> $GITHUB_ENV
echo "empty-artifact-content=_EMPTY_" >> $GITHUB_ENV

- name: Create files that will be uploaded
run: |
mkdir artifact-path
echo ${{ env.non-gzip-artifact-content }} > artifact-path/world.txt
echo ${{ env.gzip-artifact-content }} > artifact-path/gzip.txt
touch artifact-path/empty.txt
echo -n 'hello from file 1' > artifact-path/first.txt
echo -n 'hello from file 2' > artifact-path/second.txt

# We're using node -e to call the functions directly available in the @actions/artifact package
- name: Upload artifacts using uploadArtifact()
run: |
node -e "Promise.resolve(require('./packages/artifact/lib/artifact-client').create().uploadArtifact('my-artifact-1',['artifact-path/world.txt'], '${{ github.workspace }}'))"
node -e "Promise.resolve(require('./packages/artifact/lib/artifact-client').create().uploadArtifact('my-artifact-2',['artifact-path/gzip.txt'], '${{ github.workspace }}'))"
node -e "Promise.resolve(require('./packages/artifact/lib/artifact-client').create().uploadArtifact('my-artifact-3',['artifact-path/empty.txt'], '${{ github.workspace }}'))"
- name: Upload Artifacts
uses: actions/github-script@v7
with:
script: |
const {default: artifact} = require('./packages/artifact/lib/artifact')

- name: Download artifacts using downloadArtifact()
run: |
mkdir artifact-1-directory
node -e "Promise.resolve(require('./packages/artifact/lib/artifact-client').create().downloadArtifact('my-artifact-1','artifact-1-directory'))"
mkdir artifact-2-directory
node -e "Promise.resolve(require('./packages/artifact/lib/artifact-client').create().downloadArtifact('my-artifact-2','artifact-2-directory'))"
mkdir artifact-3-directory
node -e "Promise.resolve(require('./packages/artifact/lib/artifact-client').create().downloadArtifact('my-artifact-3','artifact-3-directory'))"

- name: Verify downloadArtifact()
shell: bash
run: |
packages/artifact/__tests__/test-artifact-file.sh "artifact-1-directory/artifact-path/world.txt" "${{ env.non-gzip-artifact-content }}"
packages/artifact/__tests__/test-artifact-file.sh "artifact-2-directory/artifact-path/gzip.txt" "${{ env.gzip-artifact-content }}"
packages/artifact/__tests__/test-artifact-file.sh "artifact-3-directory/artifact-path/empty.txt" "${{ env.empty-artifact-content }}"
const artifactName = 'my-artifact-${{ matrix.runs-on }}'
console.log('artifactName: ' + artifactName)

- name: Download artifacts using downloadAllArtifacts()
run: |
mkdir multi-artifact-directory
node -e "Promise.resolve(require('./packages/artifact/lib/artifact-client').create().downloadAllArtifacts('multi-artifact-directory'))"
const fileContents = ['artifact-path/first.txt','artifact-path/second.txt']

const uploadResult = await artifact.uploadArtifact(artifactName, fileContents, './')
console.log(uploadResult)

- name: Verify downloadAllArtifacts()
shell: bash
const size = uploadResult.size
const id = uploadResult.id

console.log(`Successfully uploaded artifact ${id}`)

try {
await artifact.uploadArtifact(artifactName, fileContents, './')
throw new Error('should have failed second upload')
} catch (err) {
console.log('Successfully blocked second artifact upload')
}
verify:
name: Verify and Delete
runs-on: ubuntu-latest
needs: [upload]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

# Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible
# without these to just compile the artifacts package
- name: Install root npm packages
run: npm ci

- name: Compile artifact package
run: |
packages/artifact/__tests__/test-artifact-file.sh "multi-artifact-directory/my-artifact-1/artifact-path/world.txt" "${{ env.non-gzip-artifact-content }}"
packages/artifact/__tests__/test-artifact-file.sh "multi-artifact-directory/my-artifact-2/artifact-path/gzip.txt" "${{ env.gzip-artifact-content }}"
packages/artifact/__tests__/test-artifact-file.sh "multi-artifact-directory/my-artifact-3/artifact-path/empty.txt" "${{ env.empty-artifact-content }}"
npm ci
npm run tsc
working-directory: packages/artifact

- name: List and Download Artifacts
uses: actions/github-script@v7
with:
script: |
const {default: artifactClient} = require('./packages/artifact/lib/artifact')

const {readFile} = require('fs/promises')
const path = require('path')

const findBy = {
repositoryOwner: process.env.GITHUB_REPOSITORY.split('/')[0],
repositoryName: process.env.GITHUB_REPOSITORY.split('/')[1],
token: '${{ secrets.GITHUB_TOKEN }}',
workflowRunId: process.env.GITHUB_RUN_ID
}

const listResult = await artifactClient.listArtifacts({latest: true, findBy})
console.log(listResult)

const artifacts = listResult.artifacts
const expected = [
'my-artifact-ubuntu-latest',
'my-artifact-windows-latest',
'my-artifact-macos-latest'
]

const foundArtifacts = artifacts.filter(artifact =>
expected.includes(artifact.name)
)

if (foundArtifacts.length !== 3) {
console.log('Unexpected length of found artifacts', foundArtifacts)
throw new Error(
`Expected 3 artifacts but found ${foundArtifacts.length} artifacts.`
)
}

console.log('Successfully listed artifacts that were uploaded')

const files = [
{name: 'artifact-path/first.txt', content: 'hello from file 1'},
{name: 'artifact-path/second.txt', content: 'hello from file 2'}
]

for (const artifact of foundArtifacts) {
const {downloadPath} = await artifactClient.downloadArtifact(artifact.id, {
path: artifact.name,
findBy
})

console.log('Downloaded artifact to:', downloadPath)

for (const file of files) {
const filepath = path.join(
process.env.GITHUB_WORKSPACE,
downloadPath,
file.name
)

console.log('Checking file:', filepath)

const content = await readFile(filepath, 'utf8')
if (content.trim() !== file.content.trim()) {
throw new Error(
`Expected file '${file.name}' to contain '${file.content}' but found '${content}'`
)
}
}
}
- name: Delete Artifacts
uses: actions/github-script@v7
with:
script: |
const {default: artifactClient} = require('./packages/artifact/lib/artifact')

const artifactsToDelete = [
'my-artifact-ubuntu-latest',
'my-artifact-windows-latest',
'my-artifact-macos-latest'
]

for (const artifactName of artifactsToDelete) {
const {id} = await artifactClient.deleteArtifact(artifactName)
}

const {artifacts} = await artifactClient.listArtifacts({latest: true})
const foundArtifacts = artifacts.filter(artifact =>
artifactsToDelete.includes(artifact.name)
)

if (foundArtifacts.length !== 0) {
console.log('Unexpected length of found artifacts:', foundArtifacts)
throw new Error(
`Expected 0 artifacts but found ${foundArtifacts.length} artifacts.`
)
}

13 changes: 6 additions & 7 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set Node.js 12.x
uses: actions/setup-node@v1
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 12.x
node-version: 20.x

- name: npm install
run: npm install

- name: Bootstrap
run: npm run bootstrap

- name: audit tools
# `|| npm audit` to pretty-print the output if vulnerabilies are found after filtering.
run: npm audit --audit-level=moderate --json | scripts/audit-allow-list || npm audit --audit-level=moderate
- name: audit tools (without allow-list)
run: npm audit --audit-level=moderate --omit dev

- name: audit packages
run: npm run audit-all
8 changes: 4 additions & 4 deletions .github/workflows/cache-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set Node.js 12.x
uses: actions/setup-node@v1
- name: Set Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 12.x
node-version: 20.x

# In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the
# node context. This runs a local action that gets and sets the necessary env variables that are needed
Expand Down
Loading