Test action label checker #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Label Checker | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- labeled | |
- unlabeled | |
jobs: | |
check_labels: | |
name: Check labels | |
runs-on: ubuntu-latest | |
env: | |
hasValidLabels: true | |
steps: | |
- name: Get and check PR labels | |
id: pr-labels | |
uses: joerick/[email protected] | |
- run: | | |
if [ -n "enhancement" ]; then | |
echo "POUET" | |
${{ env.hasValidLabels }} = false | |
echo "POUET POUET : ${{ env.hasValidLabels }}" | |
fi | |
- name: Comment if missing labels | |
uses: actions/github-script@v4 | |
if: ${{ env.hasValidLabels == false }} | |
with: | |
script: | | |
// Post a warning comment | |
github.issues.createComment({ | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: ':x: @'+context.repo.owner+' your PR does not include any descriptive label :x:<br>:warning: :warning: :warning:<br> Make sure to add an appropriate [PR label](https://github.com/sofa-framework/sofa/labels) before merge.' | |
}); | |
github-token: ${{ secrets.GITHUB_TOKEN }} |