Added check to see if the pull request contains a lable #3
Workflow file for this run
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: Check for label on pull request | |
on: | |
pull_request: | |
types: [opened, labeled, unlabeled] | |
branches: | |
- main | |
jobs: | |
check-lables: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get PR labels | |
run: | | |
PR_LABELS="${{ join(github.event.pull_request.labels.*.name, ',') }}" | |
echo "PR_LABELS=$PR_LABELS" >> $GITHUB_ENV | |
echo "Labels fetched: $PR_LABELS" | |
- name: Contains lable | |
run: | | |
if [ -z "$PR_LABELS" ]; then # cehcks if PR_LABLES length is zero | |
echo "The pull request needs a lable." | |
exit 1 #This fails the action | |
fi | |
- name: Check if pull request is up to standart | |