Skip to content

Commit 26cdb4f

Browse files
committed
ci(secrets): Skip steps if secrets not set
1 parent 3b49525 commit 26cdb4f

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/docs_deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ permissions:
1919
jobs:
2020
deploy-prod-docs:
2121
name: Deploy Documentation on Production
22+
if: github.repository == 'espressif/arduino-esp32'
2223
runs-on: ubuntu-22.04
2324
defaults:
2425
run:

.github/workflows/tests_hw_wokwi.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ jobs:
6868
path: artifacts/matrix_info
6969

7070
- name: Get info
71+
env:
72+
GITLAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
7173
id: set-ref
7274
run: |
7375
pr_num=$(jq -r '.pull_request.number' artifacts/event_file/event.json | tr -cd "[:digit:]")
@@ -90,16 +92,21 @@ jobs:
9092
base=${{ github.ref }}
9193
fi
9294
93-
hw_tests_enabled="true"
94-
if [[ -n "$pr_num" ]]; then
95-
# This is a PR, check for hil_test label
96-
has_hil_label=$(jq -r '.pull_request.labels[]?.name' artifacts/event_file/event.json 2>/dev/null | grep -q "hil_test" && echo "true" || echo "false")
97-
echo "Has hil_test label: $has_hil_label"
95+
if [ -n "$GITLAB_ACCESS_TOKEN" ]; then
96+
hw_tests_enabled="true"
97+
if [[ -n "$pr_num" ]]; then
98+
# This is a PR, check for hil_test label
99+
has_hil_label=$(jq -r '.pull_request.labels[]?.name' artifacts/event_file/event.json 2>/dev/null | grep -q "hil_test" && echo "true" || echo "false")
100+
echo "Has hil_test label: $has_hil_label"
98101
99-
if [[ "$has_hil_label" != "true" ]]; then
100-
echo "PR does not have hil_test label, hardware tests will be disabled"
101-
hw_tests_enabled="false"
102+
if [[ "$has_hil_label" != "true" ]]; then
103+
echo "PR does not have hil_test label, hardware tests will be disabled"
104+
hw_tests_enabled="false"
105+
fi
102106
fi
107+
else
108+
echo "GITLAB_ACCESS_TOKEN is not set, hardware tests will be disabled"
109+
hw_tests_enabled="false"
103110
fi
104111
105112
push_time=$(jq -r '.repository.pushed_at' artifacts/event_file/event.json | tr -cd "[:alnum:]:-")

0 commit comments

Comments
 (0)