Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
make check-labels a github action workflow
  • Loading branch information
s3krit committed Feb 10, 2021
commit 9b37fb0b44381490a000d00d9a1bf6adc9814303
16 changes: 16 additions & 0 deletions .github/workflows/check-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Check labels

on:
pull_request:
types: [labeled, opened, synchronize, unlabeled]

jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Check labels
run: bash ${{ github.workspace }}/.maintain/github/check_labels.sh
env:
GITHUB_PR: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 0 additions & 11 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -687,14 +687,3 @@ validator 4 4:
<<: *validator-deploy
script:
- ./.maintain/flamingfir-deploy.sh flamingfir-validator4

#### stage: .post

check-labels:
stage: .post
image: paritytech/tools:latest
<<: *kubernetes-build
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
script:
- ./.maintain/gitlab/check_labels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
#shellcheck source=../common/lib.sh
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh"

repo="$GITHUB_REPOSITORY"
pr="$GITHUB_PR"

ensure_labels() {
for label in "$@"; do
if has_label 'paritytech/substrate' "$CI_COMMIT_BRANCH" "$label"; then
if has_label "$repo" "$pr" "$label"; then
return 0
fi
done
Expand All @@ -27,15 +30,15 @@ criticality_labels=(
'C9-critical'
)

echo "[+] Checking release notes (B) labels for $CI_COMMIT_BRANCH"
echo "[+] Checking release notes (B) labels"
if ensure_labels "${releasenotes_labels[@]}"; then
echo "[+] Release notes label detected. All is well."
else
echo "[!] Release notes label not detected. Please add one of: ${releasenotes_labels[*]}"
exit 1
fi

echo "[+] Checking release criticality (C) labels for $CI_COMMIT_BRANCH"
echo "[+] Checking release criticality (C) labels"
if ensure_labels "${criticality_labels[@]}"; then
echo "[+] Release criticality label detected. All is well."
else
Expand Down