Skip to content

Commit d1a6fea

Browse files
committed
chore: add workflow to check if change file is included in a PR
1 parent 463bb72 commit d1a6fea

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Change File Included in PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, labeled]
6+
7+
jobs:
8+
check-files-in-directory:
9+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'Release Not Needed') && !contains(github.event.pull_request.labels.*.name, 'Release PR') }}
10+
name: Change File Included in PR
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout PR code
15+
uses: actions/checkout@v3
16+
17+
- name: Get List of Changed Files
18+
id: changed-files
19+
uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf #v45
20+
21+
- name: Check for Change File(s) in .autover/changes/
22+
run: |
23+
DIRECTORY=".autover/changes/"
24+
if echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -q "$DIRECTORY"; then
25+
echo "✅ One or more change files in '$DIRECTORY' are included in this PR."
26+
else
27+
echo "❌ No change files in '$DIRECTORY' are included in this PR."
28+
echo "Refer to the 'Adding a change file to your contribution branch' section of https://github.com/aws/aws-aspnet-cognito-identity-provider/blob/master/CONTRIBUTING.md"
29+
exit 1
30+
fi

0 commit comments

Comments
 (0)