简体   繁体   中英

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?

在此处输入图片说明

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM