Compare commits

..

3 Commits

Author SHA1 Message Date
dependabot[bot]
b099550a4e Bump the non-breaking-changes group across 1 directory with 2 updates
Bumps the non-breaking-changes group with 2 updates in the / directory: [@vercel/ncc](https://github.com/vercel/ncc) and [prettier](https://github.com/prettier/prettier).


Updates `@vercel/ncc` from 0.38.1 to 0.45.0
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.38.1...0.45.0)

Updates `prettier` from 3.3.3 to 3.9.6
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.3...3.9.6)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-version: 0.38.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: non-breaking-changes
- dependency-name: prettier
  dependency-version: 3.8.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: non-breaking-changes
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-17 19:23:18 +00:00
Adwitiya goyal
5e98f10ce2 Merge pull request #440 from actions/user/adwitiya
Improve deployment request test coverage
2026-08-14 14:27:34 +05:30
Adwitiya goyal
8b0625abb5 Improve deployment request test coverage 2026-08-13 09:18:38 +00:00
3 changed files with 64 additions and 10 deletions

18
package-lock.json generated
View File

@@ -16,14 +16,14 @@
"http-status-messages": "^1.1.0"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1",
"@vercel/ncc": "^0.45.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-github": "^4.10.2",
"jest": "^29.7.0",
"make-coverage-badge": "^1.2.0",
"nock": "^13.5.4",
"prettier": "^3.3.3",
"prettier": "^3.9.6",
"undici": "^6.19.2"
}
},
@@ -2348,10 +2348,11 @@
"dev": true
},
"node_modules/@vercel/ncc": {
"version": "0.38.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.1.tgz",
"integrity": "sha512-IBBb+iI2NLu4VQn3Vwldyi2QwaXt5+hTyh58ggAMoCGE6DJmPvwL3KPBWcJl1m9LYPChBLE980Jw+CS4Wokqxw==",
"version": "0.45.0",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.45.0.tgz",
"integrity": "sha512-8zPi1yO2mHpoKTD+e+Bf0ZT3e+sWHSOyGapm9s7b5R0gxJi3CiFTqmeQiMEyu6ejrz2s09M8JkEoUaTWjBJPQQ==",
"dev": true,
"license": "MIT",
"bin": {
"ncc": "dist/ncc/cli.js"
}
@@ -6951,10 +6952,11 @@
}
},
"node_modules/prettier": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
"integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
"version": "3.9.6",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz",
"integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin/prettier.cjs"
},

View File

@@ -11,14 +11,14 @@
"http-status-messages": "^1.1.0"
},
"devDependencies": {
"@vercel/ncc": "^0.38.1",
"@vercel/ncc": "^0.45.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-github": "^4.10.2",
"jest": "^29.7.0",
"make-coverage-badge": "^1.2.0",
"nock": "^13.5.4",
"prettier": "^3.3.3",
"prettier": "^3.9.6",
"undici": "^6.19.2"
},
"scripts": {

View File

@@ -121,6 +121,58 @@ describe('Deployment', () => {
twirpScope.done()
})
it('can successfully create a deployment with a 64-character build version', async () => {
process.env.GITHUB_SHA = 'a'.repeat(64)
const twirpScope = nock(process.env.ACTIONS_RESULTS_URL)
.post(LIST_ARTIFACTS_TWIRP_PATH)
.reply(
200,
{
artifacts: [{ databaseId: 11, name: 'github-pages', size: 221 }]
},
{ headers: { 'content-type': 'application/json' } }
)
mockPool
.intercept({
path: `/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments`,
method: 'POST',
body: bodyString => {
const body = JSON.parse(bodyString)
const keys = Object.keys(body).sort()
return (
keys.length === 3 &&
keys[0] === 'artifact_id' &&
keys[1] === 'oidc_token' &&
keys[2] === 'pages_build_version' &&
body.artifact_id === 11 &&
body.pages_build_version === process.env.GITHUB_SHA &&
body.oidc_token === fakeJwt
)
}
})
.reply(
200,
{
status_url: `https://api.github.com/repos/${process.env.GITHUB_REPOSITORY}/pages/deployments/${process.env.GITHUB_SHA}`,
page_url: 'https://actions.github.io/is-awesome'
},
{ headers: { 'content-type': 'application/json' } }
)
const deployment = new Deployment()
await deployment.create(fakeJwt)
expect(process.env.GITHUB_SHA).toHaveLength(64)
expect(core.setFailed).not.toHaveBeenCalled()
expect(core.info).toHaveBeenLastCalledWith(
expect.stringMatching(new RegExp(`^Created deployment for ${process.env.GITHUB_SHA}`))
)
twirpScope.done()
})
it('can successfully create a preview deployment', async () => {
process.env.GITHUB_SHA = 'valid-build-version'