Skip to content

Test action label checker #26

Test action label checker

Test action label checker #26

Workflow file for this run

---
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"
echo "false" >> ${{ env.hasValidLabels }}
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 }}