diff --git a/.github/workflows/moved-files.yml b/.github/workflows/moved-files.yml new file mode 100644 index 00000000000..7c6ea0d1c66 --- /dev/null +++ b/.github/workflows/moved-files.yml @@ -0,0 +1,34 @@ +name: Alias reminder + +# This action only works on pull request events +on: + pull_request: + types: [opened, synchronize] + +jobs: + alias-reminder: + name: Check for moved files + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{github.event.pull_request.head.sha}} + fetch-depth: 0 + - name: Temp config + id: check_files_moved + outputs: + docs_changed: ${{ steps.check_files_moved.outputs.files_moved }} + run: | + $diff = git diff -M --find-renames=10 --summary main + $SourceDiff = $diff | Where-Object { $_ -match '.md$' } + $HasDiff = $SourceDiff.Length -gt 0 + + Write-Host "::set-output name=files_moved::$HasDiff" + - name: Comment on PR with changed files + if: steps.check_file_changed.outputs.files_moved == 'True' + uses: marocchino/sticky-pull-request-comment@v2.2.0 + with: + recreate: true + message: 'It looks like the following files were renamed. Please ensure you set aliases correctly:\n $(git diff -M --find-renames=10 --summary main | grep md)' + GITHUB_TOKEN: ${{ secrets.PR_TOKEN }} \ No newline at end of file diff --git a/renamed.txt b/renamed.txt new file mode 100644 index 00000000000..e69de29bb2d