File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6565 run : |
6666 gh pr edit $PR_URL --add-label docs-content-fr
6767
68+ # Check if the PR is connected to an issue that has the DIY docs label. If yes, then add the DIY docs label to the PR.
69+ - name : Check if PR is connected to DIY docs issue
70+ id : check-diy-docs
71+ env :
72+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73+ run : |
74+ ISSUE_NUMS=$(echo "${{ github.event.pull_request.body }}" | grep -oE '#[0-9]+' | tr -d '#')
75+ for ISSUE_NUM in $ISSUE_NUMS; do
76+ LABELS=$(gh issue view $ISSUE_NUM --json labels --jq '.labels[].name')
77+ if echo "$LABELS" | grep -q 'DIY docs'; then
78+ echo "DIY_DOCS_LABEL=true" >> $GITHUB_ENV
79+ break
80+ fi
81+ done
82+
83+ - name : Add the DIY docs label if connected to a DIY docs issue
84+ if : ${{ env.DIY_DOCS_LABEL == 'true' }}
85+ env :
86+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
87+ PR_URL : ${{ github.event.pull_request.html_url }}
88+ run : |
89+ gh pr edit $PR_URL --add-label 'DIY docs'
90+
6891 # Add to the FR project
6992 # and set type to "Maintenance" or "External contributor PR"
7093 # and set date to now
You can’t perform that action at this time.
0 commit comments