Skip to content

Commit fa0c379

Browse files
committed
fix: 🐛 Properly set default config for usage as node module
1 parent 361d3f0 commit fa0c379

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/constants.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import {isNullOrUndefined, stripProtocolFromUrl} from './util'
44

55
const {pusher, repository} = github.context.payload
66

7-
/* Flags to signal different scenarios to test cases */
7+
/*
8+
* Flags to signal different scenarios to test cases
9+
*/
810
export enum TestFlag {
911
NONE = 0,
1012
HAS_CHANGED_FILES = 1 << 1, // Assume changes to commit.

src/lib.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {exportVariable, info, notice, setFailed, setOutput} from '@actions/core'
2-
import {ActionInterface, NodeActionInterface, Status} from './constants'
2+
import {action, ActionInterface, NodeActionInterface, Status} from './constants'
33
import {deploy, init} from './git'
44
import {configureSSH} from './ssh'
55
import {
@@ -11,12 +11,11 @@ import {
1111
isNullOrUndefined
1212
} from './util'
1313

14-
/** Initializes and runs the action.
15-
*
16-
* @param {object} configuration - The action configuration.
14+
/**
15+
* Initializes and runs the action.
1716
*/
1817
export default async function run(
19-
configuration: ActionInterface | NodeActionInterface
18+
configuration?: ActionInterface | NodeActionInterface
2019
): Promise<void> {
2120
let status: Status = Status.RUNNING
2221

@@ -51,6 +50,7 @@ export default async function run(
5150
info('Checking configuration and starting deployment… 🚦')
5251

5352
const settings: ActionInterface = {
53+
...action,
5454
...configuration,
5555
// Set the default branch for Node configurations
5656
branch: !isNullOrUndefined(configuration.branch)

src/main.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import {action} from './constants'
21
import run from './lib'
32

4-
// Runs the action within the GitHub actions environment.
5-
run(action)
3+
run()

0 commit comments

Comments
 (0)