Skip to content

Commit

Permalink
Add auth
Browse files Browse the repository at this point in the history
  • Loading branch information
kpgalligan committed Dec 17, 2023
1 parent 06d3e4c commit 1f4f2ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
8 changes: 8 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ branding:
icon: 'heart'
color: 'red'

inputs:
username:
description: 'Github Username'
required: true
pat:
description: 'Github PAT'
required: true

runs:
using: node20
main: dist/index.js
15 changes: 3 additions & 12 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,13 @@ import simpleGit from "simple-git";
*/
export async function run(): Promise<void> {
try {
const commitMessage: string = core.getInput('commitMessage')
const tagMessage: string = core.getInput('tagMessage')
const tagVersion: string = core.getInput('tagVersion')
const branchName: string = core.getInput('branchName')

core.debug(`commitMessage: ${commitMessage}`)
core.debug(`tagMessage: ${tagMessage}`)
core.debug(`tagVersion: ${tagVersion}`)
core.debug(`branchName: ${branchName}`)

const username: string = core.getInput('username')
const pat: string = core.getInput('pat')
const git = simpleGit();

Check failure on line 12 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Delete `;`

Check failure on line 12 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Extra semicolon


//git subtree push --prefix subtreeDirectory https://github.com/newfivefour/vimrc.git master

Check failure on line 14 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Insert `····`

await git.raw("subtree", "push", "--prefix", "kmp", "https://github.com/kpgalligan/SharedKotlin.git", "testbranch")
await git.raw("subtree", "push", "--prefix", "kmp", `https://${username}:${pat}@github.com/kpgalligan/SharedKotlin.git`, "testbranch")

Check failure on line 16 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Replace `"subtree",·"push",·"--prefix",·"kmp",·`https://${username}:${pat}@github.com/kpgalligan/SharedKotlin.git`,·"testbranch"` with `⏎······'subtree',⏎······'push',⏎······'--prefix',⏎······'kmp',⏎······`https://${username}:${pat}@github.com/kpgalligan/SharedKotlin.git`,⏎······'testbranch'⏎····`
} catch (error) {
// Fail the workflow run if an error occurs
if (error instanceof Error) core.setFailed(error.message)
Expand Down

0 comments on commit 1f4f2ab

Please sign in to comment.