Skip to content

Commit db8229a

Browse files
committed
Address Copilot review feedback
- Filter all semver pre-releases via jq select(contains("-") | not) instead of a narrow rc|alpha|beta|dev regex. - Add explicit permissions block (contents: read, actions: write) so gh workflow run works regardless of repo default token scope. - Emit missing_count output and gate dispatch on that, avoiding the trailing-newline-in-heredoc edge case where outputs.missing != '' could evaluate truthy for an empty list. - Dedupe registry versions with sort -Vu. - Per-target concurrency group on manifest matrix so the 4 targets still parallelize within a run; only across-run writes to the same target's manifest file serialize.
1 parent d6a9483 commit db8229a

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
permissions:
9393
contents: write
9494
concurrency:
95-
group: release-publish
95+
group: release-publish-${{ matrix.target }}
9696
cancel-in-progress: false
9797
strategy:
9898
matrix:

.github/workflows/check-update.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
- cron: '0 6 * * *' # Daily at 6 AM UTC
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
actions: write
11+
812
jobs:
913
check:
1014
runs-on: ubuntu-latest
@@ -14,10 +18,11 @@ jobs:
1418
env:
1519
GH_TOKEN: ${{ github.token }}
1620
run: |
17-
# Stable versions from the ESP component registry (exclude pre-releases)
21+
# Stable versions from the ESP component registry (exclude any semver
22+
# pre-release, i.e. anything with a '-' identifier like 3.0.0-rc1).
1823
AVAILABLE=$(curl -s "https://components.espressif.com/api/components/espressif/esp_hosted" \
19-
| jq -r '.versions[].version' \
20-
| grep -viE 'rc|alpha|beta|dev')
24+
| jq -r '.versions[].version | select(contains("-") | not)' \
25+
| sort -Vu)
2126
2227
# Versions already released (strip leading v, skip manifest tag)
2328
RELEASED=$(gh release list --repo "${{ github.repository }}" --limit 200 \
@@ -33,7 +38,7 @@ jobs:
3338
MISSING=""
3439
else
3540
# Missing = stable versions strictly newer than HIGHEST
36-
MISSING=$(echo "$AVAILABLE" | sort -V | awk -v h="$HIGHEST" '
41+
MISSING=$(echo "$AVAILABLE" | awk -v h="$HIGHEST" '
3742
function ver_gt(a, b, as, bs, i, an, bn) {
3843
n = split(a, as, "."); split(b, bs, ".")
3944
for (i = 1; i <= n; i++) {
@@ -46,21 +51,25 @@ jobs:
4651
ver_gt($0, h)')
4752
fi
4853
54+
# Count non-empty lines
55+
COUNT=$(printf '%s\n' "$MISSING" | grep -cve '^$' || true)
56+
4957
echo "Available stable versions:"
5058
echo "$AVAILABLE"
5159
echo "Already released:"
5260
echo "$RELEASED"
53-
echo "Missing versions to build:"
61+
echo "Missing versions to build ($COUNT):"
5462
echo "$MISSING"
5563
5664
{
65+
echo "count=$COUNT"
5766
echo "missing<<EOF"
5867
echo "$MISSING"
5968
echo "EOF"
6069
} >> "$GITHUB_OUTPUT"
6170
6271
- name: Dispatch build for each missing version
63-
if: steps.todo.outputs.missing != ''
72+
if: steps.todo.outputs.count != '0'
6473
env:
6574
GH_TOKEN: ${{ github.token }}
6675
run: |

0 commit comments

Comments
 (0)