mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Merge branch 'dev' of https://github.com/JamesIves/github-pages-deploy-action into dev
This commit is contained in:
commit
9508791a92
@ -137,7 +137,7 @@ By default the action does not need any token configuration and uses the provide
|
|||||||
| Key | Value Information | Type | Required |
|
| Key | Value Information | Type | Required |
|
||||||
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
|
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | -------- |
|
||||||
| `git-config-name` | Allows you to customize the name that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the name in the GitHub context, followed by the name of the action. | `with` | **No** |
|
| `git-config-name` | Allows you to customize the name that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the name in the GitHub context, followed by the name of the action. | `with` | **No** |
|
||||||
| `git-config-email` | Allows you to customize the email that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the email in the GitHub context, followed by a generic noreply GitHub email. You can include `<>` for the value if you wish to omit this field altogether and push the commits without an email. | `with` | **No** |
|
| `git-config-email` | Allows you to customize the email that is attached to the git config which is used when pushing the deployment commits. If this is not included it will use the email in the GitHub context, followed by a generic noreply GitHub email. You can include `<>` for the value if you wish to omit this field altogether and push the commits without an email. | `with` | **No** |
|
||||||
| `repository-name` | Allows you to specify a different repository path so long as you have permissions to push to it. This should be formatted like so: `JamesIves/github-pages-deploy-action`. You'll need to use a PAT in the `token` input for this configuration option to work properly. | `with` | **No** |
|
| `repository-name` | Allows you to specify a different repository path so long as you have permissions to push to it. This should be formatted like so: `JamesIves/github-pages-deploy-action`. You'll need to use a PAT in the `token` input for this configuration option to work properly. | `with` | **No** |
|
||||||
| `target-folder` | If you'd like to push the contents of the deployment folder into a specific directory on the deployment branch you can specify it here. | `with` | **No** |
|
| `target-folder` | If you'd like to push the contents of the deployment folder into a specific directory on the deployment branch you can specify it here. | `with` | **No** |
|
||||||
| `commit-message` | If you need to customize the commit message for an integration you can do so. | `with` | **No** |
|
| `commit-message` | If you need to customize the commit message for an integration you can do so. | `with` | **No** |
|
||||||
|
@ -7,7 +7,7 @@ The current version is actively maintained and will receive frequent updates and
|
|||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| ------- | ------------------ |
|
| ------- | ------------------ |
|
||||||
| 4.0.x | :white_check_mark: |
|
| 4.0.x | :white_check_mark: |
|
||||||
| < 4.0.0 | :x: |
|
| < 4.0.0 | :x: |
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
process.env['INPUT_FOLDER'] = 'build'
|
process.env['INPUT_FOLDER'] = 'build'
|
||||||
process.env['GITHUB_SHA'] = '123'
|
process.env['GITHUB_SHA'] = '123'
|
||||||
process.env['INPUT_DEBUG'] = 'debug'
|
process.env['INPUT_DEBUG'] = 'debug'
|
||||||
|
process.env['GITHUB_REF_NAME'] = 'test'
|
||||||
|
|
||||||
import '../src/main'
|
import '../src/main'
|
||||||
import {action, TestFlag} from '../src/constants'
|
import {action, TestFlag} from '../src/constants'
|
||||||
|
10
src/lib.ts
10
src/lib.ts
@ -23,12 +23,12 @@ export default async function run(
|
|||||||
info(`
|
info(`
|
||||||
GitHub Pages Deploy Action 🚀
|
GitHub Pages Deploy Action 🚀
|
||||||
|
|
||||||
🚀 Getting Started Guide: https://github.com/marketplace/actions/deploy-to-github-pages
|
💖 Support: https://github.com/sponsors/JamesIves
|
||||||
❓ Discussions / Q&A: https://github.com/JamesIves/github-pages-deploy-action/discussions
|
|
||||||
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues
|
|
||||||
|
|
||||||
📣 Maintained by James Ives: https://jamesiv.es
|
📣 Maintained by James Ives: https://jamesiv.es
|
||||||
💖 Support: https://github.com/sponsors/JamesIves`)
|
|
||||||
|
🚀 Getting Started Guide: https://github.com/JamesIves/github-pages-deploy-action
|
||||||
|
❓ Discussions / Q&A: https://github.com/JamesIves/github-pages-deploy-action/discussions
|
||||||
|
🔧 Report a Bug: https://github.com/JamesIves/github-pages-deploy-action/issues`)
|
||||||
|
|
||||||
info('Checking configuration and starting deployment… 🚦')
|
info('Checking configuration and starting deployment… 🚦')
|
||||||
|
|
||||||
|
@ -43,28 +43,39 @@ export async function generateWorktree(
|
|||||||
action.workspace,
|
action.workspace,
|
||||||
action.silent
|
action.silent
|
||||||
)
|
)
|
||||||
|
|
||||||
const checkout = new GitCheckout(action.branch)
|
const checkout = new GitCheckout(action.branch)
|
||||||
|
|
||||||
if (branchExists) {
|
if (branchExists) {
|
||||||
// There's existing data on the branch to check out
|
// There's existing data on the branch to check out
|
||||||
checkout.commitish = `origin/${action.branch}`
|
checkout.commitish = `origin/${action.branch}`
|
||||||
}
|
}
|
||||||
if (!branchExists || action.singleCommit) {
|
|
||||||
// Create a new history if we don't have the branch, or if we want to reset it
|
if (
|
||||||
|
!branchExists ||
|
||||||
|
(action.singleCommit && action.branch !== process.env.GITHUB_REF_NAME)
|
||||||
|
) {
|
||||||
|
/* Create a new history if we don't have the branch, or if we want to reset it.
|
||||||
|
If the ref name is the same as the branch name, do not attempt to create an orphan of it. */
|
||||||
checkout.orphan = true
|
checkout.orphan = true
|
||||||
}
|
}
|
||||||
|
|
||||||
await execute(
|
await execute(
|
||||||
checkout.toString(),
|
checkout.toString(),
|
||||||
`${action.workspace}/${worktreedir}`,
|
`${action.workspace}/${worktreedir}`,
|
||||||
action.silent
|
action.silent
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!branchExists) {
|
if (!branchExists) {
|
||||||
info(`Created the ${action.branch} branch… 🔧`)
|
info(`Created the ${action.branch} branch… 🔧`)
|
||||||
|
|
||||||
// Our index is in HEAD state, reset
|
// Our index is in HEAD state, reset
|
||||||
await execute(
|
await execute(
|
||||||
'git reset --hard',
|
'git reset --hard',
|
||||||
`${action.workspace}/${worktreedir}`,
|
`${action.workspace}/${worktreedir}`,
|
||||||
action.silent
|
action.silent
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!action.singleCommit) {
|
if (!action.singleCommit) {
|
||||||
// New history isn't singleCommit, create empty initial commit
|
// New history isn't singleCommit, create empty initial commit
|
||||||
await execute(
|
await execute(
|
||||||
|
Loading…
Reference in New Issue
Block a user