user952342
user952342

Reputation: 2742

get latest code from github with powershell

I am creating a nightly build powershell script for an android app. It will behave like this:

  1. Get latest code from github
  2. build the android .apk file
  3. copy that apk file into a builds folder

This script will be run every night by a windows scheduled task.

I'm having trouble with automatically getting the latest code. I am being prompted for credentials. How can I write a nightly build script that includes my credentials so that I dont have type them in every single time?

enter image description here

Upvotes: 1

Views: 500

Answers (1)

VonC
VonC

Reputation: 1325137

You can add a _netrc file in C:\Users\Ben with your credentials in it:

machine github.com
login yourGitHUbLogin
password yourGitHubPassword

See "Git - How to use .netrc file on windows to save user and password".

If the idea of leaving your credential in plain text doesn't seem a good one, you can encrypt that file with gpg.

Upvotes: 2

Related Questions