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