Skip to content

Update Labels

Update Labels #48

Workflow file for this run

name: CI
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
label-check:
name: Label Check
runs-on: ubuntu-latest
outputs:
chosen_label: ${{ steps.determine_label.outputs.chosen_label }}
steps:
- name: Checkout
uses: actions/checkout@v4
# 1) Capture PR Body as Base64 (so special chars won't break the shell)
- name: Write PR Body to File
env:
BODY_B64: ${{ github.event.pull_request.body | toBase64 }}

Check failure on line 24 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 24, Col: 21): Unexpected symbol: '|'. Located at position 32 within expression: github.event.pull_request.body | toBase64
run: |
# Disable history expansion just in case
set +H
set +o histexpand
# Decode the base64 into pr_body.txt
echo "$BODY_B64" | base64 --decode > pr_body.txt
echo "Saved PR body to pr_body.txt:"
cat pr_body.txt
# 2) Determine Single Label
- name: Determine Single Label
id: determine_label
run: |
label=""
# 1) Bugfix
if grep -qE '^- \\[x\\] Bugfix' pr_body.txt; then
label="bugfix"
# 2) New feature
elif grep -qE '^- \\[x\\] New feature' pr_body.txt; then
label="new-feature"
# 3) Breaking change
elif grep -qE '^- \\[x\\] Breaking change' pr_body.txt; then
label="breaking-change"
# 4) Dependency update
elif grep -qE '^- \\[x\\] Dependency Update - Does not publish' pr_body.txt; then
label="dependency-update"
fi
echo "Chosen label: $label"
echo "chosen_label=$label" >> $GITHUB_OUTPUT
# 3) Apply Single Label (if chosen)
- name: Apply Single Label
if: ${{ steps.determine_label.outputs.chosen_label != '' }}
uses: actions-ecosystem/action-add-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: ${{ steps.determine_label.outputs.chosen_label }}
ci:
name: ESPHome Build
needs: [ label-check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
file:
- Integrations/ESPHome/PLT-1.yaml
- Integrations/ESPHome/PLT-1B.yaml
esphome-version:
- stable
- beta
- dev
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build ESPHome firmware
uses: esphome/build-action@v6
with:
yaml-file: ${{ matrix.file }}