Ash258 / Scoop-GithubActions

Deprecated. Use https://github.com/shovel-org/GithubActions
MIT License
25 stars 18 forks source link

Experiment with SSH_KEY for excavator #49

Open Ash258 opened 5 years ago

Ash258 commented 5 years ago

If repository contains protected master it will need to provide ssh key as secret.

if ($env:SSH_KEY) {
    Set-Content "$HOME\.ssh\id_rsa" $env:SSH_KEY -Encoding ASCII
} else {
    git config remote-url ... $user:$token
}

If it will work. Note, example and instructions how to add have to be added into Readme.

Ash258 commented 5 years ago

https://github.community/t5/GitHub-Actions/How-to-push-to-protected-branches-in-a-GitHub-Action/m-p/30710/highlight/true#M526

Maybe some workaround with SSH / machine user / whatever could work. Need to investigate

Ash258 commented 4 years ago

Try with workaround without hub first and then hacky way with hub

    $remote = "https://${env:GITHUB_ACTOR}:${env:GITHUB_TOKEN}@github.com/${env:GITHUB_REPOSITORY}.git"
    git push $remote

Actor needs to be admin