name: CI

on:
  workflow_dispatch:
  push:
    branches: [master]

jobs:
  build:

    runs-on: ubuntu-latest
    timeout-minutes: 15

    steps:
    - uses: actions/checkout@v2.3.3

    - name: Set up Python 3.7
      uses: actions/setup-python@v2
      with:
        python-version: 3.7

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install moban
        pip install xattr

    - name: Sync GitHub's master template repository of templates
      run: .github/scripts/sync-github.sh

    - name: Run moban then lint templates for white space
      run: |
        moban
        .github/scripts/check-whitespace.sh

    - name: Create branch
      run: |
        git config user.name github-actions
        git config user.email github-actions@github.com

        git checkout -b sync_github

        git add .
        git commit -m "Sync Templates with Github"
        git push -f origin sync_github

    # Creates a PR with the new combined branch
    - uses: actions/github-script@v3
      name: Create Pull Request
      with:
        github-token: ${{secrets.GITHUB_TOKEN}}
        script: |
          await github.pulls.create({
            owner: context.repo.owner,
            repo: context.repo.repo,
            title: 'Sync Github',
            head: 'sync_github',
            base: 'master',
            body: 'This PR was created by the CI Github action fetching updates from Github'
          });

name: CI

on:
  workflow_dispatch:

jobs:
  build:

    runs-on: ubuntu-latest
    timeout-minutes: 15

    steps:
    - uses: actions/checkout@v2.3.3

    - name: Set up Python 3.7
      uses: actions/setup-python@v2
      with:
        python-version: 3.7

    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install moban
        pip install xattr

    - name: Sync GitHub's master template repository of templates
      run: .github/scripts/sync-github.sh

    - name: Run moban then lint templates for white space
      run: |
        moban
        .github/scripts/check-whitespace.sh

    - name: Create branch
      run: |
        git config user.name github-actions
        git config user.email github-actions@github.com

        git checkout -b sync_github

        git add .
        git commit -m "Sync Templates with Github"
        git push -f origin sync_github

    # Creates a PR with the new combined branch
    - uses: actions/github-script@v3
      name: Create Pull Request
      with:
        github-token: ${{secrets.GITHUB_TOKEN}}
        script: |
          await github.pulls.create({
            owner: context.repo.owner,
            repo: context.repo.repo,
            title: 'Sync Github',
            head: 'sync_github',
            base: 'master',
            body: 'This PR was created by the CI Github action fetching updates from Github'
          });

Change Lint WF to manual execution only
Change Lint WF to manual execution only

[no ci]