Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: JamesIves/github-pages-deploy-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.3.1
Choose a base ref
...
head repository: JamesIves/github-pages-deploy-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.3.2
Choose a head ref
  • 4 commits
  • 5 files changed
  • 1 contributor

Commits on Apr 23, 2022

  1. Release 4.3.1 📣

    JamesIves committed Apr 23, 2022

    Verified

    This commit was signed with the committer’s verified signature.
    yorickvP Yorick
    Copy the full SHA
    459b667 View commit details
  2. Permission modifications

    JamesIves committed Apr 23, 2022
    1

    Verified

    This commit was signed with the committer’s verified signature.
    yorickvP Yorick
    Copy the full SHA
    1549ea0 View commit details
  3. Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    7cde9b7 View commit details
  4. Copy the full SHA
    55974d4 View commit details
Showing with 24 additions and 15 deletions.
  1. +10 −10 __tests__/git.test.ts
  2. +2 −2 __tests__/main.test.ts
  3. +3 −1 lib/git.js
  4. +1 −1 package.json
  5. +8 −1 src/git.ts
20 changes: 10 additions & 10 deletions __tests__/git.test.ts
Original file line number Diff line number Diff line change
@@ -168,7 +168,7 @@ describe('git', () => {
const response = await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(13)
expect(execute).toBeCalledTimes(14)
expect(rmRF).toBeCalledTimes(1)
expect(response).toBe(Status.SUCCESS)
})
@@ -191,7 +191,7 @@ describe('git', () => {
const response = await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(12)
expect(execute).toBeCalledTimes(13)
expect(rmRF).toBeCalledTimes(1)
expect(response).toBe(Status.SUCCESS)
})
@@ -216,7 +216,7 @@ describe('git', () => {
await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(13)
expect(execute).toBeCalledTimes(14)
expect(rmRF).toBeCalledTimes(1)
})

@@ -240,7 +240,7 @@ describe('git', () => {
await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(12)
expect(execute).toBeCalledTimes(13)
expect(rmRF).toBeCalledTimes(1)
})

@@ -265,7 +265,7 @@ describe('git', () => {
await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(12)
expect(execute).toBeCalledTimes(13)
expect(rmRF).toBeCalledTimes(1)
})

@@ -296,7 +296,7 @@ describe('git', () => {
const response = await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(13)
expect(execute).toBeCalledTimes(14)
expect(rmRF).toBeCalledTimes(1)
expect(fs.existsSync).toBeCalledTimes(2)
expect(response).toBe(Status.SUCCESS)
@@ -328,7 +328,7 @@ describe('git', () => {
await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(10)
expect(execute).toBeCalledTimes(11)
expect(rmRF).toBeCalledTimes(1)
})
})
@@ -353,7 +353,7 @@ describe('git', () => {
await deploy(action)

// Includes the call to generateWorktree
expect(execute).toBeCalledTimes(10)
expect(execute).toBeCalledTimes(11)
expect(rmRF).toBeCalledTimes(1)
})

@@ -373,7 +373,7 @@ describe('git', () => {

await deploy(action)

expect(execute).toBeCalledTimes(10)
expect(execute).toBeCalledTimes(11)
expect(rmRF).toBeCalledTimes(1)
expect(mkdirP).toBeCalledTimes(1)
})
@@ -393,7 +393,7 @@ describe('git', () => {
})

const response = await deploy(action)
expect(execute).toBeCalledTimes(10)
expect(execute).toBeCalledTimes(11)
expect(rmRF).toBeCalledTimes(1)
expect(response).toBe(Status.SKIPPED)
})
4 changes: 2 additions & 2 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ describe('main', () => {
debug: true
})
await run(action)
expect(execute).toBeCalledTimes(17)
expect(execute).toBeCalledTimes(18)
expect(rmRF).toBeCalledTimes(1)
expect(exportVariable).toBeCalledTimes(1)
})
@@ -73,7 +73,7 @@ describe('main', () => {
isTest: TestFlag.HAS_CHANGED_FILES
})
await run(action)
expect(execute).toBeCalledTimes(20)
expect(execute).toBeCalledTimes(21)
expect(rmRF).toBeCalledTimes(1)
expect(exportVariable).toBeCalledTimes(1)
})
4 changes: 3 additions & 1 deletion lib/git.js
Original file line number Diff line number Diff line change
@@ -85,6 +85,8 @@ function deploy(action) {
const branchExists = action.isTest & constants_1.TestFlag.HAS_REMOTE_BRANCH ||
Boolean((yield (0, execute_1.execute)(`git ls-remote --heads ${action.repositoryPath} refs/heads/${action.branch}`, action.workspace, action.silent)).stdout);
yield (0, worktree_1.generateWorktree)(action, temporaryDeploymentDirectory, branchExists);
/* Relaxes permissions of folder due to be deployed so rsync can write to/from it. */
yield (0, execute_1.execute)(`chmod -R +rw ${action.folderPath}`, action.workspace, action.silent);
// Ensures that items that need to be excluded from the clean job get parsed.
let excludes = '';
if (action.clean && action.cleanExclude) {
@@ -189,7 +191,7 @@ function deploy(action) {
// Cleans up temporary files/folders and restores the git state.
(0, core_1.info)('Running post deployment cleanup jobs… 🗑️');
yield (0, execute_1.execute)(`git checkout -B ${temporaryDeploymentBranch}`, `${action.workspace}/${temporaryDeploymentDirectory}`, action.silent);
yield (0, execute_1.execute)(`chmod -R 777 ${temporaryDeploymentDirectory}`, action.workspace, action.silent);
yield (0, execute_1.execute)(`chmod -R +rw ${temporaryDeploymentDirectory}`, action.workspace, action.silent);
yield (0, execute_1.execute)(`git worktree remove ${temporaryDeploymentDirectory} --force`, action.workspace, action.silent);
yield (0, io_1.rmRF)(temporaryDeploymentDirectory);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <iam@jamesiv.es> (https://jamesiv.es)",
"version": "4.3.0",
"version": "4.3.1",
"license": "MIT",
"main": "lib/lib.js",
"types": "lib/lib.d.ts",
9 changes: 8 additions & 1 deletion src/git.ts
Original file line number Diff line number Diff line change
@@ -130,6 +130,13 @@ export async function deploy(action: ActionInterface): Promise<Status> {

await generateWorktree(action, temporaryDeploymentDirectory, branchExists)

/* Relaxes permissions of folder due to be deployed so rsync can write to/from it. */
await execute(
`chmod -R +rw ${action.folderPath}`,
action.workspace,
action.silent
)

// Ensures that items that need to be excluded from the clean job get parsed.
let excludes = ''
if (action.clean && action.cleanExclude) {
@@ -324,7 +331,7 @@ export async function deploy(action: ActionInterface): Promise<Status> {
)

await execute(
`chmod -R 777 ${temporaryDeploymentDirectory}`,
`chmod -R +rw ${temporaryDeploymentDirectory}`,
action.workspace,
action.silent
)