Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: verify git auth #7

Merged
merged 1 commit into from Jan 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/git/verify-auth.ts
@@ -1,6 +1,6 @@
import { execCommand } from "./exec"

// Help from: https://github.com/semantic-release/semantic-release/blob/971a5e0d16f1a32e117e9ce382a1618c8256d0d9/lib/git.js#L196-L212
export const verifyAuth = async (branch: string, repositoryUrl: string): Promise<void> => {
await execCommand(`git push --dry-run --no-verify ${repositoryUrl} HEAD:${branch}`, "")
export const verifyAuth = async (repositoryUrl: string): Promise<void> => {
await execCommand(`git push --dry-run --no-verify`, repositoryUrl)
}
2 changes: 1 addition & 1 deletion app/index.ts
Expand Up @@ -4,6 +4,6 @@ import * as git from "./git"
const input = getInput()

const repoUrl = await git.getRepoUrl(input.githubToken)
await git.verifyAuth(input.behindBranchName, repoUrl)
await git.verifyAuth(repoUrl)
await git.rebaseSyncBranches(input.behindBranchName, input.aheadBranchName, repoUrl)
})()