-
Notifications
You must be signed in to change notification settings - Fork 8
36 lines (31 loc) · 1.09 KB
/
git-diff.yaml
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: git diff
on:
pull_request:
branches:
- master
jobs:
list-diff:
name: Fetch changed file names
if: "!contains(github.event.pull_request.labels.*.name, 'dependencies')"
runs-on: ubuntu-latest
outputs:
result: ${{ steps.changed-files.outputs.diff }}
steps:
- uses: actions/checkout@v4
- name: Fetch base branch
run: git fetch --prune --depth=1 origin ${{ github.base_ref }}
- name: Fetch changed file names
id: changed-files
run: |
echo "diff=$(git diff --diff-filter=d --name-only origin/${{ github.base_ref }} | tr '\n' ' ')" >> $GITHUB_OUTPUT
check-files-included:
name: Check the CHANGELOG.md is changed
needs: list-diff
if: contains(needs.list-diff.outputs.result, 'src')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Fetch base branch
run: git fetch --prune --depth=1 origin ${{ github.base_ref }}
- name: Check the CHANGELOG.md is updated.
run: git diff --diff-filter=d --name-only origin/${{ github.base_ref }} | grep CHANGELOG.md