Update cache.py #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check patch notes | |
on: | |
pull_request: | |
branches: | |
- in-dev | |
workflow_dispatch: | |
jobs: | |
check_patch_notes: | |
runs-on: 'ubuntu-20.04' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
# Checkout as many commits as needed for the diff | |
fetch-depth: 2 | |
- shell: pwsh | |
# Give an id to the step, so we can reference it later | |
id: check_file_changed | |
run: | | |
# Diff HEAD with the previous commit | |
$diff = git diff --name-only HEAD^ HEAD | |
# Check if a file under docs/ or with the .md extension has changed (added, modified, deleted) | |
$SourceDiff = $diff | Where-Object { $_ -match 'patch_notes.txt' } | |
$HasDiff = $SourceDiff.Length -gt 0 | |
# Set the output named "docs_changed" | |
Write-Host "::set-output name=docs_changed::$HasDiff" | |
# Run the step only with "docs_changed" equals "False" | |
- shell: pwsh | |
# steps.<step_id>.outputs.<output name> | |
if: steps.check_file_changed.outputs.docs_changed == 'False' | |
run: exit 1 |