Skip to content

Commit

Permalink
fix: found a way to default the config path
Browse files Browse the repository at this point in the history
  • Loading branch information
myyk committed Oct 16, 2023
1 parent a5c9a46 commit 0dc8f15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {run} from '../src/main'
let inputs = {
token: process.env['INPUT_TOKEN'],
repository: 'myyk/git-democracy',
configPath: './.github/workflows'
} as any

test('test runs', () => {
Expand Down
6 changes: 6 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import {GitHub} from '@actions/github/lib/utils'
import {evaluateVote} from './voting'
import {inspect} from 'util'
import {join} from 'path'

Check failure on line 24 in src/main.ts

View workflow job for this annotation

GitHub Actions / run-ncc

'join' is defined but never used

type Octokit = InstanceType<typeof GitHub>

Expand Down Expand Up @@ -186,6 +187,11 @@ export async function run(): Promise<void> {
}
core.info(`Inputs: ${inspect(inputs)}`)

if (!inputs.configPath) {
// TODO: Please someone help me understand why this was the only way to get this default to work
inputs.configPath = './.github/workflows'
}

const [owner, repo] = inputs.repository.split('/')
core.info(`repository: ${owner}/${repo}`)

Expand Down

0 comments on commit 0dc8f15

Please sign in to comment.