[ci] use external repo for check-labels (#1985)

* [ci] use external repo for check-labels

* remove ruled_labels specs, docs

* remove repo checkout

* remove checkout action

* remove old gha
This commit is contained in:
Alexander Samusev
2022-12-13 10:57:52 +01:00
committed by GitHub
parent d2a3bbe334
commit 4eeb3c851f
9 changed files with 11 additions and 468 deletions
+4 -10
View File
@@ -10,13 +10,6 @@ jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Pull image
env:
IMAGE: paritytech/ruled_labels:0.3.2
@@ -30,12 +23,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API_BASE: https://api.github.com/repos
REPO: ${{ github.repository }}
RULES_PATH: scripts/ci/ruled_labels
CHECK_SPECS: specs.yaml
RULES_PATH: labels/ruled_labels
CHECK_SPECS: specs_cumulus.yaml
run: |
echo "REPO: ${REPO}"
echo "GITHUB_PR: ${GITHUB_PR}"
# Clone repo with labels specs
git clone https://github.com/paritytech/labels
# Fetch the labels for the PR under test
labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",")
-30
View File
@@ -1,30 +0,0 @@
name: Check label Rules
on:
push:
paths:
- scripts/ci/ruled_labels/**
jobs:
check-label-rules:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Pull image
env:
IMAGE: paritytech/ruled_labels:0.3.2
run: docker pull $IMAGE
- name: Check label Rules
env:
IMAGE: paritytech/ruled_labels:0.3.2
MOUNT: /work
RULES_PATH: scripts/ci/ruled_labels
run: |
docker run --rm -i -v $PWD/${RULES_PATH}/:$MOUNT $IMAGE test ${MOUNT}/tests.yaml
-26
View File
@@ -1,26 +0,0 @@
# disabled in favor of ruled_labels tool
# name: Check labels
# on:
# pull_request:
# types: [labeled, opened, synchronize, unlabeled]
# jobs:
# check-labels:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout sources
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# ref: ${{ github.event.pull_request.head.ref }}
# repository: ${{ github.event.pull_request.head.repo.full_name }}
# - name: Check labels
# run: bash ${{ github.workspace }}/scripts/ci/github/check_labels.sh
# env:
# GITHUB_PR: ${{ github.event.pull_request.number }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# HEAD_SHA: ${{ github.event.pull_request.head.sha }}
# BASE_SHA: ${{ github.event.pull_request.base.sha }}
+4 -10
View File
@@ -8,13 +8,6 @@ jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Pull image
env:
IMAGE: paritytech/ruled_labels:0.3.2
@@ -28,12 +21,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API_BASE: https://api.github.com/repos
REPO: ${{ github.repository }}
RULES_PATH: scripts/ci/ruled_labels
CHECK_SPECS: specs.yaml
RULES_PATH: labels/ruled_labels
CHECK_SPECS: specs_cumulus.yaml
run: |
echo "REPO: ${REPO}"
echo "GITHUB_PR: ${GITHUB_PR}"
# Clone repo with labels specs
git clone https://github.com/paritytech/labels
# Fetch the labels for the PR under test
labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",")