Compare commits

..

11 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
742261a77d Fix superfluous HttpError: Not Found by throwing user-friendly errors
Instead of logging a detailed error with core.error() and then re-throwing
the raw HTTP error (which gets logged again by core.setFailed() in index.js),
throw a new Error with the user-friendly message directly. This eliminates
the duplicate/superfluous raw error output like "HttpError: Not Found".

Fixes #125

Agent-Logs-Url: https://github.com/actions/configure-pages/sessions/ee6b7f39-cfc5-415b-b70c-826c2b8cfcfe

Co-authored-by: yoannchaudet <14911070+yoannchaudet@users.noreply.github.com>
2026-04-02 17:05:57 +00:00
copilot-swe-agent[bot]
a55b1f3f2e Initial plan 2026-04-02 16:58:49 +00:00
Fabian
45bfe0192c Merge pull request #186 from salmanmkc/node24
upgrade to node 24
2026-03-24 18:32:07 -05:00
Salman Chishti
d8770c2b3b Update Node version from 20 to 24 in action.yml 2026-03-24 13:19:41 +00:00
Salman Muin Kayser Chishti
cb8a1a3280 upgrade to node 24 2025-07-29 13:24:36 +01:00
Joel Ambass
d5606572c4 Merge pull request #165 from actions/Jcambass-patch-1
Upgrade IA Publish
2024-10-03 11:03:54 +02:00
Joel Ambass
35e0ac4e40 Upgrade IA Publish 2024-09-16 17:22:15 +02:00
Joel Ambass
1dfbcbff65 Merge pull request #163 from actions/Jcambass-patch-1
Add workflow file for publishing releases to immutable action package
2024-09-12 17:20:06 +02:00
Joel Ambass
2f4f988792 Add workflow file for publishing releases to immutable action package
This workflow file publishes new action releases to the immutable action package of the same name as this repo.

This is part of the Immutable Actions project which is not yet fully released to the public. First party actions like this one are part of our initial testing of this feature.
2024-09-12 15:45:52 +02:00
Mingzi
0d7570ca87 Merge pull request #162 from actions/pin-draft-release-verssion
pin draft release version
2024-09-06 14:38:55 -07:00
Mingzi Yi
3ea19669a5 pin draft release version 2024-09-06 14:34:37 -07:00
10 changed files with 46 additions and 172 deletions

View File

@@ -12,6 +12,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: release-drafter/release-drafter@v6
- uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,20 @@
name: 'Publish Immutable Action Version'
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- name: Checking out
uses: actions/checkout@v4
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.3

View File

@@ -1 +1 @@
20.10.0
24.4.0

View File

@@ -2,7 +2,7 @@ name: 'Configure GitHub Pages'
description: 'A GitHub Action to enable Pages, extract various metadata about a site, and configure some supported static site generators.'
author: 'GitHub'
runs:
using: 'node20'
using: 'node24'
main: 'dist/index.js'
inputs:
static_site_generator:

12
dist/index.js vendored
View File

@@ -36419,11 +36419,9 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
pageObject = await getPagesSite({ githubToken })
} catch (error) {
if (!enablement) {
core.error(
`Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the \`enablement\` parameter for this action. Error: ${error.message}`,
convertErrorToAnnotationProperties(error)
throw new Error(
`Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the \`enablement\` parameter for this action.`
)
throw error
}
core.warning(`Get Pages site failed. Error: ${error.message}`, convertErrorToAnnotationProperties(error))
}
@@ -36433,8 +36431,7 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
try {
pageObject = await enablePagesSite({ githubToken })
} catch (error) {
core.error(`Create Pages site failed. Error: ${error.message}`, convertErrorToAnnotationProperties(error))
throw error
throw new Error(`Create Pages site failed. Error: ${error.message}`)
}
// This somehow implies that the Pages site was already created but initially failed to be retrieved.
@@ -36443,8 +36440,7 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
try {
pageObject = await getPagesSite({ githubToken })
} catch (error) {
core.error(`Get Pages site still failed. Error: ${error.message}`, convertErrorToAnnotationProperties(error))
throw error
throw new Error(`Get Pages site still failed. Error: ${error.message}`)
}
}
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

158
package-lock.json generated
View File

@@ -15,7 +15,7 @@
"espree": "^10.1.0"
},
"devDependencies": {
"@octokit/request-error": "^6.1.4",
"@octokit/request-error": "^5.0.1",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
@@ -1318,32 +1318,6 @@
"node": ">= 18"
}
},
"node_modules/@octokit/core/node_modules/@octokit/openapi-types": {
"version": "22.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz",
"integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg=="
},
"node_modules/@octokit/core/node_modules/@octokit/request-error": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz",
"integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==",
"dependencies": {
"@octokit/types": "^13.1.0",
"deprecation": "^2.0.0",
"once": "^1.4.0"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/@octokit/core/node_modules/@octokit/request-error/node_modules/@octokit/types": {
"version": "13.5.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz",
"integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==",
"dependencies": {
"@octokit/openapi-types": "^22.2.0"
}
},
"node_modules/@octokit/endpoint": {
"version": "9.0.4",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.4.tgz",
@@ -1417,43 +1391,11 @@
}
},
"node_modules/@octokit/request-error": {
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.4.tgz",
"integrity": "sha512-VpAhIUxwhWZQImo/dWAN/NpPqqojR6PSLgLYAituLM6U+ddx9hCioFGwBr5Mi+oi5CLeJkcAs3gJ0PYYzU6wUg==",
"dev": true,
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz",
"integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==",
"dependencies": {
"@octokit/types": "^13.0.0"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": {
"version": "22.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz",
"integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==",
"dev": true
},
"node_modules/@octokit/request-error/node_modules/@octokit/types": {
"version": "13.5.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz",
"integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==",
"dev": true,
"dependencies": {
"@octokit/openapi-types": "^22.2.0"
}
},
"node_modules/@octokit/request/node_modules/@octokit/openapi-types": {
"version": "22.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz",
"integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg=="
},
"node_modules/@octokit/request/node_modules/@octokit/request-error": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz",
"integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==",
"dependencies": {
"@octokit/types": "^13.1.0",
"@octokit/types": "^12.0.0",
"deprecation": "^2.0.0",
"once": "^1.4.0"
},
@@ -1461,14 +1403,6 @@
"node": ">= 18"
}
},
"node_modules/@octokit/request/node_modules/@octokit/request-error/node_modules/@octokit/types": {
"version": "13.5.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz",
"integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==",
"dependencies": {
"@octokit/openapi-types": "^22.2.0"
}
},
"node_modules/@octokit/types": {
"version": "12.6.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-12.6.0.tgz",
@@ -7873,33 +7807,6 @@
"@octokit/types": "^12.0.0",
"before-after-hook": "^2.2.0",
"universal-user-agent": "^6.0.0"
},
"dependencies": {
"@octokit/openapi-types": {
"version": "22.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz",
"integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg=="
},
"@octokit/request-error": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz",
"integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==",
"requires": {
"@octokit/types": "^13.1.0",
"deprecation": "^2.0.0",
"once": "^1.4.0"
},
"dependencies": {
"@octokit/types": {
"version": "13.5.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz",
"integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==",
"requires": {
"@octokit/openapi-types": "^22.2.0"
}
}
}
}
}
},
"@octokit/endpoint": {
@@ -7951,59 +7858,16 @@
"@octokit/request-error": "^5.0.0",
"@octokit/types": "^12.0.0",
"universal-user-agent": "^6.0.0"
},
"dependencies": {
"@octokit/openapi-types": {
"version": "22.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz",
"integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg=="
},
"@octokit/request-error": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.1.0.tgz",
"integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==",
"requires": {
"@octokit/types": "^13.1.0",
"deprecation": "^2.0.0",
"once": "^1.4.0"
},
"dependencies": {
"@octokit/types": {
"version": "13.5.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz",
"integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==",
"requires": {
"@octokit/openapi-types": "^22.2.0"
}
}
}
}
}
},
"@octokit/request-error": {
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-6.1.4.tgz",
"integrity": "sha512-VpAhIUxwhWZQImo/dWAN/NpPqqojR6PSLgLYAituLM6U+ddx9hCioFGwBr5Mi+oi5CLeJkcAs3gJ0PYYzU6wUg==",
"dev": true,
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-5.0.1.tgz",
"integrity": "sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==",
"requires": {
"@octokit/types": "^13.0.0"
},
"dependencies": {
"@octokit/openapi-types": {
"version": "22.2.0",
"resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-22.2.0.tgz",
"integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==",
"dev": true
},
"@octokit/types": {
"version": "13.5.0",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-13.5.0.tgz",
"integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==",
"dev": true,
"requires": {
"@octokit/openapi-types": "^22.2.0"
}
}
"@octokit/types": "^12.0.0",
"deprecation": "^2.0.0",
"once": "^1.4.0"
}
},
"@octokit/types": {

View File

@@ -30,7 +30,7 @@
"espree": "^10.1.0"
},
"devDependencies": {
"@octokit/request-error": "^6.1.4",
"@octokit/request-error": "^5.0.1",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",

View File

@@ -43,11 +43,9 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
pageObject = await getPagesSite({ githubToken })
} catch (error) {
if (!enablement) {
core.error(
`Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the \`enablement\` parameter for this action. Error: ${error.message}`,
convertErrorToAnnotationProperties(error)
throw new Error(
`Get Pages site failed. Please verify that the repository has Pages enabled and configured to build using GitHub Actions, or consider exploring the \`enablement\` parameter for this action.`
)
throw error
}
core.warning(`Get Pages site failed. Error: ${error.message}`, convertErrorToAnnotationProperties(error))
}
@@ -57,8 +55,7 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
try {
pageObject = await enablePagesSite({ githubToken })
} catch (error) {
core.error(`Create Pages site failed. Error: ${error.message}`, convertErrorToAnnotationProperties(error))
throw error
throw new Error(`Create Pages site failed. Error: ${error.message}`)
}
// This somehow implies that the Pages site was already created but initially failed to be retrieved.
@@ -67,8 +64,7 @@ async function findOrCreatePagesSite({ githubToken, enablement = true }) {
try {
pageObject = await getPagesSite({ githubToken })
} catch (error) {
core.error(`Get Pages site still failed. Error: ${error.message}`, convertErrorToAnnotationProperties(error))
throw error
throw new Error(`Get Pages site still failed. Error: ${error.message}`)
}
}
}

View File

@@ -169,8 +169,7 @@ describe('apiClient', () => {
})
} catch (error) {
erred = true
// re-raised error
expect(error.response.status).toEqual(404)
expect(error.message).toContain('Get Pages site failed')
}
expect(erred).toBe(true)
expect(mockGetPages).toHaveBeenCalledTimes(1)
@@ -188,8 +187,7 @@ describe('apiClient', () => {
})
} catch (error) {
erred = true
// re-raised error
expect(error.response.status).toEqual(500)
expect(error.message).toContain('Create Pages site failed')
}
expect(erred).toBe(true)
expect(mockGetPages).toHaveBeenCalledTimes(1)