# This is a basic workflow to help you get started with Actions

name: DailyGeneration

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  schedule:
    - cron: "0 8 * * *"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2
      
      - name: Integrate master branch
        env:
          key: ${{secrets.GHA_Deploy_Key}}
        run: |
          git checkout $(Build.SourceBranchName)
          git pull
          git merge --no-commit --no-ff --strategy-option=theirs origin/master
          if ! git diff-index --quiet HEAD --; then
            git commit -m "Merge remote-tracking branch 'origin/master' into $(Build.SourceBranchName)"
            git push origin $(Build.SourceBranchName)
          fi

Create daily generation GH Action
Create daily generation GH Action