Как я могу добавить git учетные данные в рабочем процессе Github - PullRequest
1 голос
/ 21 января 2020

Вопрос:

Как добавить git учетные данные в рабочем процессе GitHub?

nodejs .yml

name: Node CI

on:
  push:
    branches: 
      - master
      - gh-pages 

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [8.x, 10.x]

    steps:
    - uses: actions/checkout@v1
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: npm run deploy
      run: |
        npm install
        npm run deploy  
      env:
        CI: t

Ответы [ 2 ]

1 голос
/ 22 января 2020

Я исправил это так:

nodejs .yml

name: Node CI

on:
  push:
    branches: 
      - master

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [8.x]

    steps:
    - uses: actions/checkout@v1

    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}

    - uses: fusion-engineering/setup-git-credentials@v2
      with:
        credentials: ${{secrets.GIT_CREDENTIAL}}

    - name: npm run deploy
      run: |
        export GIT_USER=${{secrets.GIT_USER}}
        git config --global user.name "$GIT_USER"
        git config --global user.email "hi@pushe.co"
        npm install
        npm run deploy  
      env:
        CI: true
0 голосов
/ 21 января 2020

Для этого есть функция, посмотрите секреты github .

...