name: Weekly E2E Test Check
on:
  workflow_dispatch:
  schedule:
    - cron: '0 0 * * 0'

permissions:
  contents: write

jobs:
  full-e2e-check:
    runs-on: [self-hosted, 1ES.Pool=<YOUR_REPO_NAME>]
    environment:
      name: crontests
    steps:
      - name: checkout
        uses: actions/checkout@v3
      - name: init
        run: |
          docker run --rm -v $(pwd):/src -w /src mcr.microsoft.com/azterraform:latest make generate
      - name: e2e test
        continue-on-error: true
        run: |
          sh scripts/ci-e2e.sh
      - name: Update
        run: |
          sh scripts/ci-update-test-record.sh
      - name: Commit & Push changes
        uses: actions-js/push@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          message: 'Update TestVersionSnapshot'
          branch: ${{ github.event.repository.default_branch }}