-
Notifications
You must be signed in to change notification settings - Fork 42
36 lines (33 loc) · 1.37 KB
/
alias-reminder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Alias reminder
on:
pull_request_target:
branches: [ main ]
types: [ labeled, 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: Check for moved files
shell: pwsh
id: check_files_moved
run: |
$diff = git diff -M --find-renames=10 --summary ${{github.event.pull_request.base.sha}}
$SourceDiff = $diff | Where-Object { $_ -match 'rename.*.md.*$' }
$HasDiff = $SourceDiff.Length -gt 0
Write-Host "::set-output name=files_moved::$HasDiff"
Write-Host "::set-output name=files::$SourceDiff"
- name: Comment on PR with changed files
if: steps.check_files_moved.outputs.files_moved == 'True'
uses: marocchino/[email protected]
with:
recreate: true
message: |
It looks like the following files may have been renamed. Please ensure you set all needed aliases:
${{ steps.check_files_moved.outputs.files }}
GITHUB_TOKEN: ${{ secrets.PR_TOKEN }}