File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ name : close-charts
2+
3+ on :
4+ pull_request :
5+ types : [opened, synchronize, reopened]
6+
7+ jobs :
8+ check-and-close :
9+ runs-on : ubuntu-latest
10+ permissions :
11+ pull-requests : write
12+ contents : read
13+
14+ steps :
15+ - name : Check for modified chart doc files
16+ id : check
17+ run : |
18+ echo "Checking for modified files..."
19+ CHANGED_FILES=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files --jq '.[].filename')
20+
21+ echo "$CHANGED_FILES" | grep -E '^src/content/docs/charts/' && echo "found=true" >> $GITHUB_OUTPUT || echo "found=false" >> $GITHUB_OUTPUT
22+ env :
23+ GH_TOKEN : ${{ github.token }}
24+
25+ - name : Close PR if chart docs were modified
26+ if : steps.check.outputs.found == 'true'
27+ run : |
28+ gh pr comment ${{ github.event.pull_request.number }} --body 'Changes to chart docs cannot be submitted here.
29+ They need to be submitted to https://github.com/trueforge-org/truecharts instead'
30+
31+ gh pr close ${{ github.event.pull_request.number }}
32+ env :
33+ GH_TOKEN : ${{ github.token }}
You can’t perform that action at this time.
0 commit comments