Skip to content

Commit

Permalink
Test github action
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Sep 16, 2023
1 parent 3599254 commit 563f8b4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/moved-files.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}
Empty file added renamed.txt
Empty file.

0 comments on commit 563f8b4

Please sign in to comment.