forked from opendatahub-io/opendatahub-operator
-
Notifications
You must be signed in to change notification settings - Fork 15
44 lines (42 loc) · 1.49 KB
/
check-file-updates.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
37
38
39
40
41
42
43
44
name: Check config and readme updates
on:
pull_request:
jobs:
file-updates:
permissions:
pull-requests: write
name: Ensure generated files are included
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate files
id: generate-files
run: |
CMD="make generate manifests api-docs"
$CMD
echo "CMD=$CMD" >> $GITHUB_OUTPUT
- name: Ensure generated files are up-to-date
id: check_generated_files
run : |
if [[ -n $(git status -s) ]]
then
echo "Generated files have been missed in the PR"
git diff
echo "missing_generated_files=true" >> $GITHUB_OUTPUT
else
echo "No new files to commit"
echo "missing_generated_files=false" >> $GITHUB_OUTPUT
fi
- name: Report issue in PR
if: ${{ steps.check_generated_files.outputs.missing_generated_files == 'true' }}
uses: thollander/actions-comment-pull-request@v2
with:
message: |
## This PR can't be merged just yet 😢
Please run `${{ steps.generate-files.outputs.CMD }}` and commit the changes.
For more info: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Print git status and fail pr
if: ${{ steps.check_generated_files.outputs.missing_generated_files == 'true' }}
run: |
git status
exit 1