Skip to content

Commit

Permalink
Merge branch 'dev' into releases/v4
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Dec 3, 2024
2 parents dc18a3c + 389b85f commit d5dce9b
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 20 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@jamesives/github-pages-deploy-action",
"description": "GitHub action for building a project and deploying it to GitHub pages.",
"author": "James Ives <[email protected]> (https://jamesiv.es)",
"version": "4.7.0",
"version": "4.7.1",
"license": "MIT",
"main": "lib/lib.js",
"types": "lib/lib.d.ts",
Expand Down Expand Up @@ -47,7 +47,7 @@
"@types/node": "22.10.1",
"@typescript-eslint/eslint-plugin": "8.16.0",
"@typescript-eslint/parser": "8.16.0",
"eslint": "9.15.0",
"eslint": "9.16.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-jest": "28.9.0",
"eslint-plugin-prettier": "5.2.1",
Expand Down
7 changes: 5 additions & 2 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {generateWorktree} from './worktree'
import {
extractErrorMessage,
isNullOrUndefined,
suppressSensitiveInformation
suppressSensitiveInformation,
getRsyncVersion
} from './util'

/**
Expand Down Expand Up @@ -110,6 +111,8 @@ export async function deploy(action: ActionInterface): Promise<Status> {
const temporaryDeploymentBranch = `github-pages-deploy-action/${Math.random()
.toString(36)
.substr(2, 9)}`
const rsyncVersion = getRsyncVersion()
const isMkpathSupported = rsyncVersion >= '3.2.3'

info('Starting to commit changes…')

Expand Down Expand Up @@ -166,7 +169,7 @@ export async function deploy(action: ActionInterface): Promise<Status> {
Allows the user to specify the root if '.' is provided.
rsync is used to prevent file duplication. */
await execute(
`rsync -q -av --checksum --progress ${action.targetFolder ? '--mkpath' : ''} ${action.folderPath}/. ${
`rsync -q -av --checksum --progress ${isMkpathSupported && action.targetFolder ? '--mkpath' : ''} ${action.folderPath}/. ${
action.targetFolder
? `${temporaryDeploymentDirectory}/${action.targetFolder}`
: temporaryDeploymentDirectory
Expand Down
18 changes: 18 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {isDebug, warning} from '@actions/core'
import {execSync} from 'child_process'
import {existsSync} from 'fs'
import path from 'path'
import {
Expand Down Expand Up @@ -140,3 +141,20 @@ export const extractErrorMessage = (error: unknown): string =>
*/
export const stripProtocolFromUrl = (url: string): string =>
url.replace(/^(?:https?:\/\/)?(?:www\.)?/i, '').split('/')[0]

/**
* Gets the rsync version.
*/
export function getRsyncVersion(): string {
try {
const versionOutput = execSync('rsync --version').toString()
const versionMatch = versionOutput.match(
/rsync\s+version\s+(\d+\.\d+\.\d+)/
)
return versionMatch ? versionMatch[1] : ''
} catch (error) {
console.error(error)

return ''
}
}
113 changes: 97 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -667,10 +667,10 @@
minimatch "^3.1.2"
strip-json-comments "^3.1.1"

"@eslint/js@9.15.0", "@eslint/js@^9.0.0":
version "9.15.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.15.0.tgz#df0e24fe869143b59731942128c19938fdbadfb5"
integrity sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==
"@eslint/js@9.16.0", "@eslint/js@^9.0.0":
version "9.16.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.16.0.tgz#3df2b2dd3b9163056616886c86e4082f45dbf3f4"
integrity sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==

"@eslint/object-schema@^2.1.4":
version "2.1.4"
Expand Down Expand Up @@ -1251,6 +1251,21 @@
natural-compare "^1.4.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "8.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.17.0.tgz#2ee073c421f4e81e02d10e731241664b6253b23c"
integrity sha512-HU1KAdW3Tt8zQkdvNoIijfWDMvdSweFYm4hWh+KwhPstv+sCmWb89hCIP8msFm9N1R/ooh9honpSuvqKWlYy3w==
dependencies:
"@eslint-community/regexpp" "^4.10.0"
"@typescript-eslint/scope-manager" "8.17.0"
"@typescript-eslint/type-utils" "8.17.0"
"@typescript-eslint/utils" "8.17.0"
"@typescript-eslint/visitor-keys" "8.17.0"
graphemer "^1.4.0"
ignore "^5.3.1"
natural-compare "^1.4.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "8.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.16.0.tgz#ee5b2d6241c1ab3e2e53f03fd5a32d8e266d8e06"
Expand All @@ -1262,6 +1277,17 @@
"@typescript-eslint/visitor-keys" "8.16.0"
debug "^4.3.4"

"@typescript-eslint/[email protected]":
version "8.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.17.0.tgz#2ee972bb12fa69ac625b85813dc8d9a5a053ff52"
integrity sha512-Drp39TXuUlD49F7ilHHCG7TTg8IkA+hxCuULdmzWYICxGXvDXmDmWEjJYZQYgf6l/TFfYNE167m7isnc3xlIEg==
dependencies:
"@typescript-eslint/scope-manager" "8.17.0"
"@typescript-eslint/types" "8.17.0"
"@typescript-eslint/typescript-estree" "8.17.0"
"@typescript-eslint/visitor-keys" "8.17.0"
debug "^4.3.4"

"@typescript-eslint/[email protected]":
version "8.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz#ebc9a3b399a69a6052f3d88174456dd399ef5905"
Expand All @@ -1270,6 +1296,14 @@
"@typescript-eslint/types" "8.16.0"
"@typescript-eslint/visitor-keys" "8.16.0"

"@typescript-eslint/[email protected]":
version "8.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.17.0.tgz#a3f49bf3d4d27ff8d6b2ea099ba465ef4dbcaa3a"
integrity sha512-/ewp4XjvnxaREtqsZjF4Mfn078RD/9GmiEAtTeLQ7yFdKnqwTOgRMSvFz4et9U5RiJQ15WTGXPLj89zGusvxBg==
dependencies:
"@typescript-eslint/types" "8.17.0"
"@typescript-eslint/visitor-keys" "8.17.0"

"@typescript-eslint/[email protected]":
version "8.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.16.0.tgz#585388735f7ac390f07c885845c3d185d1b64740"
Expand All @@ -1280,11 +1314,26 @@
debug "^4.3.4"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "8.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.17.0.tgz#d326569f498cdd0edf58d5bb6030b4ad914e63d3"
integrity sha512-q38llWJYPd63rRnJ6wY/ZQqIzPrBCkPdpIsaCfkR3Q4t3p6sb422zougfad4TFW9+ElIFLVDzWGiGAfbb/v2qw==
dependencies:
"@typescript-eslint/typescript-estree" "8.17.0"
"@typescript-eslint/utils" "8.17.0"
debug "^4.3.4"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "8.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.16.0.tgz#49c92ae1b57942458ab83d9ec7ccab3005e64737"
integrity sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==

"@typescript-eslint/[email protected]":
version "8.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.17.0.tgz#ef84c709ef8324e766878834970bea9a7e3b72cf"
integrity sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA==

"@typescript-eslint/[email protected]":
version "8.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz#9d741e56e5b13469b5190e763432ce5551a9300c"
Expand All @@ -1299,7 +1348,21 @@
semver "^7.6.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]", "@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0":
"@typescript-eslint/[email protected]":
version "8.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.17.0.tgz#40b5903bc929b1e8dd9c77db3cb52cfb199a2a34"
integrity sha512-JqkOopc1nRKZpX+opvKqnM3XUlM7LpFMD0lYxTqOTKQfCWAmxw45e3qlOCsEqEB2yuacujivudOFpCnqkBDNMw==
dependencies:
"@typescript-eslint/types" "8.17.0"
"@typescript-eslint/visitor-keys" "8.17.0"
debug "^4.3.4"
fast-glob "^3.3.2"
is-glob "^4.0.3"
minimatch "^9.0.4"
semver "^7.6.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/[email protected]":
version "8.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.16.0.tgz#c71264c437157feaa97842809836254a6fc833c3"
integrity sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==
Expand All @@ -1309,6 +1372,16 @@
"@typescript-eslint/types" "8.16.0"
"@typescript-eslint/typescript-estree" "8.16.0"

"@typescript-eslint/[email protected]", "@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0":
version "8.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.17.0.tgz#41c05105a2b6ab7592f513d2eeb2c2c0236d8908"
integrity sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w==
dependencies:
"@eslint-community/eslint-utils" "^4.4.0"
"@typescript-eslint/scope-manager" "8.17.0"
"@typescript-eslint/types" "8.17.0"
"@typescript-eslint/typescript-estree" "8.17.0"

"@typescript-eslint/[email protected]":
version "8.16.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz#d5086afc060b01ff7a4ecab8d49d13d5a7b07705"
Expand All @@ -1317,6 +1390,14 @@
"@typescript-eslint/types" "8.16.0"
eslint-visitor-keys "^4.2.0"

"@typescript-eslint/[email protected]":
version "8.17.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.17.0.tgz#4dbcd0e28b9bf951f4293805bf34f98df45e1aa8"
integrity sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg==
dependencies:
"@typescript-eslint/types" "8.17.0"
eslint-visitor-keys "^4.2.0"

acorn-jsx@^5.3.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
Expand Down Expand Up @@ -1786,17 +1867,17 @@ eslint-visitor-keys@^4.2.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45"
integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==

eslint@9.15.0:
version "9.15.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.15.0.tgz#77c684a4e980e82135ebff8ee8f0a9106ce6b8a6"
integrity sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==
eslint@9.16.0:
version "9.16.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.16.0.tgz#66832e66258922ac0a626f803a9273e37747f2a6"
integrity sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==
dependencies:
"@eslint-community/eslint-utils" "^4.2.0"
"@eslint-community/regexpp" "^4.12.1"
"@eslint/config-array" "^0.19.0"
"@eslint/core" "^0.9.0"
"@eslint/eslintrc" "^3.2.0"
"@eslint/js" "9.15.0"
"@eslint/js" "9.16.0"
"@eslint/plugin-kit" "^0.2.3"
"@humanfs/node" "^0.16.6"
"@humanwhocodes/module-importer" "^1.0.1"
Expand Down Expand Up @@ -3290,13 +3371,13 @@ type-fest@^0.8.1:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"

typescript-eslint@^8.13.0:
version "8.16.0"
resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.16.0.tgz#d608c972d6b2461ca10ec30fd3fa62a080baba19"
integrity sha512-wDkVmlY6O2do4V+lZd0GtRfbtXbeD0q9WygwXXSJnC1xorE8eqyC2L1tJimqpSeFrOzRlYtWnUp/uzgHQOgfBQ==
version "8.17.0"
resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.17.0.tgz#fa4033c26b3b40f778287bc12918d985481b220b"
integrity sha512-409VXvFd/f1br1DCbuKNFqQpXICoTB+V51afcwG1pn1a3Cp92MqAUges3YjwEdQ0cMUoCIodjVDAYzyD8h3SYA==
dependencies:
"@typescript-eslint/eslint-plugin" "8.16.0"
"@typescript-eslint/parser" "8.16.0"
"@typescript-eslint/utils" "8.16.0"
"@typescript-eslint/eslint-plugin" "8.17.0"
"@typescript-eslint/parser" "8.17.0"
"@typescript-eslint/utils" "8.17.0"

[email protected]:
version "5.7.2"
Expand Down

0 comments on commit d5dce9b

Please sign in to comment.