From 40499a40844178c9fc5ceebc9b81cdd509c78924 Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Tue, 29 Nov 2022 13:03:46 -0500 Subject: [PATCH] prevent unsupported locale setting error in GHA related to https://github.com/ansible/ansible/pull/78175 the way the GHA runner is built, Python runs with a mixed locale between the FS bits and the default encoding, which can cause unpredictable issues adding env var `LC_ALL: "C.UTF-8"` prevent flakiness due to locale issue Signed-off-by: Hao Liu --- .github/workflows/ci.yml | 1 + .github/workflows/devel_images.yml | 2 ++ .github/workflows/e2e_test.yml | 3 +++ .github/workflows/feature_branch_deletion.yml | 2 ++ .github/workflows/promote.yml | 4 ++++ .github/workflows/stage.yml | 4 ++++ .github/workflows/upload_schema.yml | 4 ++++ 7 files changed, 20 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15ff2598a7..b47efc0c3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI env: BRANCH: ${{ github.base_ref || 'devel' }} + LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting on: pull_request: jobs: diff --git a/.github/workflows/devel_images.yml b/.github/workflows/devel_images.yml index c0ce1fb204..dbc1a4937b 100644 --- a/.github/workflows/devel_images.yml +++ b/.github/workflows/devel_images.yml @@ -1,5 +1,7 @@ --- name: Build/Push Development Images +env: + LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting on: push: branches: diff --git a/.github/workflows/e2e_test.yml b/.github/workflows/e2e_test.yml index bb54044d4f..22890fcf53 100644 --- a/.github/workflows/e2e_test.yml +++ b/.github/workflows/e2e_test.yml @@ -1,5 +1,8 @@ --- name: E2E Tests +env: + LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting + on: pull_request_target: types: [labeled] diff --git a/.github/workflows/feature_branch_deletion.yml b/.github/workflows/feature_branch_deletion.yml index c2a3bdc785..3e574b211b 100644 --- a/.github/workflows/feature_branch_deletion.yml +++ b/.github/workflows/feature_branch_deletion.yml @@ -1,5 +1,7 @@ --- name: Feature branch deletion cleanup +env: + LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting on: delete: branches: diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index 768cb8533b..820494d303 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -1,5 +1,9 @@ --- name: Promote Release + +env: + LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting + on: release: types: [published] diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index af8054058e..042b6b7b0d 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -1,5 +1,9 @@ --- name: Stage Release + +env: + LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting + on: workflow_dispatch: inputs: diff --git a/.github/workflows/upload_schema.yml b/.github/workflows/upload_schema.yml index 8f258dd7c1..4c7349abbc 100644 --- a/.github/workflows/upload_schema.yml +++ b/.github/workflows/upload_schema.yml @@ -1,5 +1,9 @@ --- name: Upload API Schema + +env: + LC_ALL: "C.UTF-8" # prevent ERROR: Ansible could not initialize the preferred locale: unsupported locale setting + on: push: branches: