forked from opendatahub-io/opendatahub-operator
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathtest-required-files-updated.yaml
More file actions
36 lines (36 loc) · 1.34 KB
/
test-required-files-updated.yaml
File metadata and controls
36 lines (36 loc) · 1.34 KB
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: Check config and readme updates
on:
pull_request:
jobs:
file-updates:
name: Ensure generated files are included
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Save the PR number for artifact upload
run: |
echo ${{ github.event.number }} > pr_number.txt
- name: Upload the PR number as artifact
id: artifact-upload
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: pr_number
path: ./pr_number.txt
retention-days: 1 # This will delete the generated artifacts every day.
- name: Generate files
run: make generate manifests-all api-docs
- name: Ensure generated files are up-to-date
id: check_generated_files
run : |
rm ./pr_number.txt # remove the pr_number.txt before checking "git status", to have correct assessment of the changed files.
if [[ -n $(git status -s) ]]
then
echo "Generated files have been missed in the PR"
git diff
exit 1
else
echo "No new files to commit"
fi