mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Configures supported operating system check (#981)
This commit is contained in:
parent
a5d8ac6765
commit
66847f0074
5
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
5
.github/ISSUE_TEMPLATE/BUG_REPORT.md
vendored
@ -8,16 +8,21 @@ labels:
|
|||||||
<!-- Please check the Q&A before posting an issue: https://github.com/JamesIves/github-pages-deploy-action/discussions?discussions_q=category%3AQ%26A -->
|
<!-- Please check the Q&A before posting an issue: https://github.com/JamesIves/github-pages-deploy-action/discussions?discussions_q=category%3AQ%26A -->
|
||||||
|
|
||||||
## Describe the bug
|
## Describe the bug
|
||||||
|
|
||||||
<!-- Please provide a clear and concise description of what the bug is. -->
|
<!-- Please provide a clear and concise description of what the bug is. -->
|
||||||
|
|
||||||
## Reproduction Steps
|
## Reproduction Steps
|
||||||
|
|
||||||
<!-- Steps to reproduce the behavior. -->
|
<!-- Steps to reproduce the behavior. -->
|
||||||
|
|
||||||
## Logs
|
## Logs
|
||||||
|
|
||||||
<!-- Please provide your deployment logs. If the error message isn't revealing the problem please set ACTIONS_STEP_DEBUG to true in your repository's secrets menu and run the workflow again. -->
|
<!-- Please provide your deployment logs. If the error message isn't revealing the problem please set ACTIONS_STEP_DEBUG to true in your repository's secrets menu and run the workflow again. -->
|
||||||
|
|
||||||
## Workflow
|
## Workflow
|
||||||
|
|
||||||
<!-- Please provide a link or snippet of your workflow yml file. -->
|
<!-- Please provide a link or snippet of your workflow yml file. -->
|
||||||
|
|
||||||
## Additional Comments
|
## Additional Comments
|
||||||
|
|
||||||
<!--Add any other context about the problem here. -->
|
<!--Add any other context about the problem here. -->
|
||||||
|
@ -148,3 +148,12 @@ export enum Status {
|
|||||||
SKIPPED = 'skipped',
|
SKIPPED = 'skipped',
|
||||||
RUNNING = 'running'
|
RUNNING = 'running'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Platform codes. */
|
||||||
|
export enum OperatingSystems {
|
||||||
|
LINUX = 'Linux',
|
||||||
|
WINDOWS = 'Windows',
|
||||||
|
MACOS = 'macOS'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const SupportedOperatingSystems = [OperatingSystems.LINUX]
|
||||||
|
19
src/util.ts
19
src/util.ts
@ -1,7 +1,12 @@
|
|||||||
import {isDebug} from '@actions/core'
|
import {isDebug, info} from '@actions/core'
|
||||||
import {existsSync} from 'fs'
|
import {existsSync} from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import {ActionInterface, RequiredActionParameters} from './constants'
|
import {
|
||||||
|
ActionInterface,
|
||||||
|
OperatingSystems,
|
||||||
|
RequiredActionParameters,
|
||||||
|
SupportedOperatingSystems
|
||||||
|
} from './constants'
|
||||||
|
|
||||||
/* Replaces all instances of a match in a string. */
|
/* Replaces all instances of a match in a string. */
|
||||||
const replaceAll = (input: string, find: string, replace: string): string =>
|
const replaceAll = (input: string, find: string, replace: string): string =>
|
||||||
@ -66,6 +71,16 @@ export const checkParameters = (action: ActionInterface): void => {
|
|||||||
`The directory you're trying to deploy named ${action.folderPath} doesn't exist. Please double check the path and any prerequisite build scripts and try again. ❗`
|
`The directory you're trying to deploy named ${action.folderPath} doesn't exist. Please double check the path and any prerequisite build scripts and try again. ❗`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
SupportedOperatingSystems.includes(
|
||||||
|
process.env.RUNNER_OS as OperatingSystems
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
info(
|
||||||
|
`The operating system you're using is not supported and results may be varied. Please refer to the documentation for more details. ❗`
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Suppresses sensitive information from being exposed in error messages. */
|
/* Suppresses sensitive information from being exposed in error messages. */
|
||||||
|
Loading…
Reference in New Issue
Block a user