Skip to content

Commit d5d0488

Browse files
committed
Update ESP-IDF workflow to conditionally add version tag only on master branch
- Modify the logic for adding the ESP-IDF version tag to ensure it is only included when the workflow is triggered on the master branch. - Adjust handling of custom tags to maintain flexibility in tagging based on branch context.
1 parent 8c437cb commit d5d0488

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/esp-idf.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,15 @@ jobs:
4949
ESP_IDF_VERSION="${{ github.event.inputs.esp_idf_version || env.ESP_IDF_VERSION }}"
5050
CUSTOM_TAGS="${{ github.event.inputs.custom_tags || '' }}"
5151
52-
# Add ESP-IDF version tag
53-
if [ -n "$CUSTOM_TAGS" ]; then
54-
TAGS="${CUSTOM_TAGS},${ESP_IDF_VERSION}"
52+
# Add ESP-IDF version tag only on master branch
53+
if [ "${{ github.ref_name }}" == "master" ]; then
54+
if [ -n "$CUSTOM_TAGS" ]; then
55+
TAGS="${CUSTOM_TAGS},${ESP_IDF_VERSION}"
56+
else
57+
TAGS="${ESP_IDF_VERSION}"
58+
fi
5559
else
56-
TAGS="${ESP_IDF_VERSION}"
60+
TAGS="${CUSTOM_TAGS}"
5761
fi
5862
5963
echo "esp_idf_version=${ESP_IDF_VERSION}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)