name: Check for NVDA-2020.4
on:
  
  schedule:
    # * is a special character in YAML so you have to quote this string
    - cron:  '0 * * * *'

jobs:
  update-release-link:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Update release
      run: |
        import re
        import urllib
        url = "https://github.com/nvaccess/nvda/releases/latest"
        response = urllib.urlopen(url)
        text = response.read()
        
        def hasReleaseUpdate():
          if "2020.4" in text:
            return True
          return False
          
        if hasReleaseUpdate():
          with open("_layouts/default.html", 'r+') as f:
            text = f.read()
            text = re.sub(".3", ".4", text)
            f.seek(0)
            f.write(text)
            f.truncate()
        else:
          print("Release not updated yet")
      shell: python 
     
        
    - name: Push changes
      run: |
        git config user.name github-actions
        git config user.email github-actions@github.com
        git add .
        git commit -m "Update release link"
        git push
                
        
name: Check for NVDA-2020.4
on:
  
  schedule:
    # * is a special character in YAML so you have to quote this string
    - cron:  '0 * * * *'

jobs:
  update-release-link:
    runs-on: windows-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Set up Python 3.7 x86
      uses: actions/setup-python@v2
      with:
        python-version: 3.7
        architecture: x86

    - name: Update release
      run: |
        import re
        import urllib.request
        url = "https://github.com/nvaccess/nvda/releases/latest"
        response = urllib.request.urlopen(url)
        text = response.read()
        
        def hasReleaseUpdate():
          if "2020.4" in text:
            return True
          return False
          
        if hasReleaseUpdate():
          with open("_layouts/default.html", 'r+', encoding='utf-8') as f:
            text = f.read()
            text = re.sub(".3", ".3", text)
            f.seek(0)
            f.write(text)
            f.truncate()
        else:
          raise Exception("Release not updated yet")
      shell: python 
    
    - name: Push changes
      run: |
        git config user.name github-actions
        git config user.email github-actions@github.com
        git add .
        git commit -m "Update release link"
        git push
    - name: Checkout NVDA
      uses: actions/checkout@v2
      with:
        repository: nvaccess/nvda
        submodules: true
        ref: release-2020.4
    - name: Prepare NVDA
      run: |
        scons source
        scons dist
      shell: cmd

Use raise instead of print in workflow
Use raise instead of print in workflow
