Skip to content

Commit

Permalink
New label management method
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthio committed May 11, 2024
1 parent 6813901 commit 2f47b7e
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 8 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/create-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: MatrixCreator

run-name: "Creates supported target matrix for other jobs"

on:
workflow_call:
inputs:
labelname:
required: true
type: string

jobs:
CreateLabel:
runs-on: ubuntu-latest
steps:
- name: Print Job
run: echo "Create ${{ inputs.labelname }} tags"

- name: Create tag if doesn't exists
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
exists=$(gh label list --search ${{ inputs.labelname }} --json name --jq '.[0].name' | wc -l)
if [ "x$exists" == "x0" ]; then
gh label ${{ inputs.labelname }}
fi
1 change: 1 addition & 0 deletions .github/workflows/dependency-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@ jobs:
branch: maintenance/${{ matrix.family }}-dependencies-update
delete-branch: true
title: Update ${{ matrix.family }} dependencies
labels: dependency-update, ${{ matrix.family }}
body: |
Update ${{ matrix.family }} to use latest ST Repos
32 changes: 32 additions & 0 deletions .github/workflows/label-management.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Manage tags

run-name: "Dynamically create new tags"

on:
push

jobs:
CreateProjectManagementLabel:
runs-on: ubuntu-latest
strategy:
matrix:
label: [ missing-devices, dependency-update ]
fail-fast: false
steps:
- uses: ./.github/workflows/create-lavel.yml
with:
labelname: ${{ matrix.label }}

RetrieveTargetsMatrix:
uses: ./.github/workflows/create-matrix.yml

CreateFamilyLabel:
runs-on: ubuntu-latest
needs: RetrieveTargetsMatrix
strategy:
matrix: ${{ fromJSON(needs.RetrieveTargetsMatrix.outputs.matrix) }}
fail-fast: false
steps:
- uses: ./.github/workflows/create-lavel.yml
with:
labelname: ${{ matrix.family }}
8 changes: 0 additions & 8 deletions .github/workflows/new-device-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ jobs:
fi
done
# - name: Manage labels
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# for l in ${{ matrix.family }} missing-devices; do
# gh label create $l
# done

- name: Manage issues
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 2f47b7e

Please sign in to comment.