this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #27221 from hannesm/add-maint-intent-ci

add a github workflow checking for x-maintenance-intent in the opam files of the PR

authored by

Marcello Seri and committed by
GitHub
ea8e97a2 59f50910

+51
+51
.github/workflows/maintenance-intent.yml
··· 1 + name: maintenance-intent present 2 + 3 + on: 4 + pull_request 5 + 6 + jobs: 7 + changed_files: 8 + runs-on: ubuntu-latest 9 + name: Check changed files for x-maintenance-intent field 10 + steps: 11 + - uses: actions/checkout@v4 12 + - name: Get changed files 13 + id: changed-files 14 + uses: tj-actions/changed-files@v45 15 + 16 + - name: Find opam files without x-maintenance-intent field 17 + id: missing-intent 18 + env: 19 + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} 20 + run: | 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 27 + fi; 28 + fi; 29 + done; 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 38 + else 39 + echo "modified=false" >> $GITHUB_OUTPUT 40 + fi 41 + 42 + - name: Add PR Comment 43 + if: steps.missing-intent.outputs.modified == 'true' 44 + uses: marocchino/sticky-pull-request-comment@v2 45 + with: 46 + recreate: true 47 + path: maint-int.md 48 + 49 + - name: Write to Job Summary 50 + if: steps.missing-intent.outputs.modified == 'true' 51 + run: cat maint-int.md >> $GITHUB_STEP_SUMMARY