···
1
-
name: maintenance-intent present
8
-
runs-on: ubuntu-latest
9
-
name: Check changed files for x-maintenance-intent field
11
-
- uses: actions/checkout@v4
12
-
- name: Get changed files
14
-
uses: tj-actions/changed-files@v45
16
-
- name: Find opam files without x-maintenance-intent field
19
-
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
21
-
for file in ${ALL_CHANGED_FILES}; do
22
-
bn=$(basename ${file})
23
-
if [ $bn = "opam" ]; then
24
-
maint_int_present=$(grep "^x-maintenance-intent: " ${file} | wc -l || true)
25
-
if [ "$maint_int_present" -eq 0 ]; then
26
-
echo "- $file" >> maint-int.md
30
-
if [ -f maint-int.md ]; then
31
-
echo "modified=true" >> $GITHUB_OUTPUT
32
-
echo "The following opam files lack the x-maintenance-intent field:" > maint-int2.md
33
-
echo "" >> maint-int2.md
34
-
cat maint-int.md >> maint-int2.md
35
-
echo "" >> maint-int2.md
36
-
echo "Please look at https://github.com/ocaml/opam-repository/blob/master/governance/policies/archiving.md#specification-of-the-x--fields-used-in-the-archiving-process for further information." >> maint-int2.md
37
-
mv maint-int2.md maint-int.md
39
-
echo "modified=false" >> $GITHUB_OUTPUT
42
-
- name: Add PR Comment
43
-
if: steps.missing-intent.outputs.modified == 'true'
44
-
uses: marocchino/sticky-pull-request-comment@v2
49
-
- name: Write to Job Summary
50
-
if: steps.missing-intent.outputs.modified == 'true'
51
-
run: cat maint-int.md >> $GITHUB_STEP_SUMMARY