From 770cf32d20f4b78159a0c09a7bf2c1c9164bd6b8 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 13 Sep 2025 22:47:38 -0700 Subject: [PATCH 1/4] Add blank lines to visually group shell command lines The `run` keys of the steps in the GitHub Actions workflows contain complex shell command lines. The readability of this code is improved by selectively adding blank lines to separate it visually into logical groupings. --- .github/workflows/publish-go-nightly-task.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-go-nightly-task.yml b/.github/workflows/publish-go-nightly-task.yml index 650071f3..aeb1c8eb 100644 --- a/.github/workflows/publish-go-nightly-task.yml +++ b/.github/workflows/publish-go-nightly-task.yml @@ -121,6 +121,7 @@ jobs: KEYCHAIN_PASSWORD: keychainpassword run: | echo "${{ secrets.INSTALLER_CERT_MAC_P12 }}" | base64 --decode >"${{ env.INSTALLER_CERT_MAC_PATH }}" + security create-keychain \ -p "${{ env.KEYCHAIN_PASSWORD }}" \ "${{ env.KEYCHAIN }}" From 32d1021ed4041422a7c9040a4368d7a6458b4d95 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 13 Sep 2025 22:48:31 -0700 Subject: [PATCH 2/4] Standardize formatting of shell code in workflow Shell scripts in Arduino tooling projects are formatted according to the style implemented by the shfmt formatting tool. In addition to standalone script files, significant quantities of complex shell code is also found in the asset tasks and workflows. shfmt can not be used to format this code (both due to the fact it is in the form of strings in YAML documents, and due to the fact that it is actually templates of shell code (making use of the templating features of Task and GitHub Actions) rather than complete shell code). However, it still makes sense to align the formatting of this code with the standardized shell code style where doing so is feasible. --- .github/workflows/publish-go-nightly-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-go-nightly-task.yml b/.github/workflows/publish-go-nightly-task.yml index aeb1c8eb..f7c4d489 100644 --- a/.github/workflows/publish-go-nightly-task.yml +++ b/.github/workflows/publish-go-nightly-task.yml @@ -205,7 +205,7 @@ jobs: -C ../../ \ LICENSE.txt - echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >> $GITHUB_ENV + echo "PACKAGE_FILENAME=$PACKAGE_FILENAME" >>$GITHUB_ENV - name: Replace artifact with notarized build uses: actions/upload-artifact@v4 From 6fe579ce7c20095c5051bcaf066837ddc73c3d93 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 13 Sep 2025 22:48:50 -0700 Subject: [PATCH 3/4] Split shell commands into multiple lines for readability The project's GitHub Actions workflows and tasks contain complex shell command lines. With the use of the line continuation operator, these commands can be split into multiple code lines. This improves readability by providing a visualization of the command structure and avoiding excessive line lengths. It also improves maintainability by making diffs for changes to these commands more clear. Previously this was done in many commands, but not consistently throughout the project. --- .github/workflows/release-go-task.yml | 3 ++- Taskfile.yml | 30 +++++++++++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-go-task.yml b/.github/workflows/release-go-task.yml index ebe88b14..e2a28ff9 100644 --- a/.github/workflows/release-go-task.yml +++ b/.github/workflows/release-go-task.yml @@ -169,7 +169,8 @@ jobs: - name: Write gon config to file # gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20) run: | - cat >"${{ env.GON_CONFIG_PATH }}" <"${{ env.GON_CONFIG_PATH }}" \ + </dev/null; then + if + ! which licensed \ + &>/dev/null + then if [[ {{OS}} == "windows" ]]; then echo "Licensed does not have Windows support." echo "Please use Linux/macOS or download the dependencies cache from the GitHub Actions workflow artifact." @@ -606,13 +609,19 @@ tasks: run: when_changed cmds: - | - if ! which go &>/dev/null; then + if + ! which go \ + &>/dev/null + then echo "Go not found or not in PATH." echo "Please install: https://go.dev/doc/install" exit 1 fi - | - if ! which python &>/dev/null; then + if + ! which python \ + &>/dev/null + then python_constraint="$( \ yq \ --input-format toml \ @@ -627,7 +636,10 @@ tasks: exit 1 fi - | - if ! which pipx &>/dev/null; then + if + ! which pipx \ + &>/dev/null + then echo "pipx not found or not in PATH." echo "Please install: https://pipx.pypa.io/stable/installation/#installing-pipx" exit 1 @@ -734,7 +746,10 @@ tasks: exit 1 fi - | - if ! which shellcheck &>/dev/null; then + if + ! which shellcheck \ + &>/dev/null + then echo "shellcheck not installed or not in PATH." echo "Please install: https://github.com/koalaman/shellcheck#installing" exit 1 @@ -774,7 +789,10 @@ tasks: exit 1 fi - | - if ! which shfmt &>/dev/null; then + if + ! which shfmt \ + &>/dev/null + then echo "shfmt not installed or not in PATH. Please install: https://github.com/mvdan/sh#shfmt" exit 1 fi From 7a9047884d42017ea09ae5d2d42ad69d3777b1c6 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 13 Sep 2025 22:49:09 -0700 Subject: [PATCH 4/4] Specify exact path of dependency license metadata cache in ignore file The "Check Dependencies" templates store a cache of metadata about the licenses of dependencies under the `.licenses` folder. Since this folder only contains generated files, it should be excluded from the validation checks performed by unrelated tools. Previously, the markdownlint ignore configuration for this folder did not explicitly specify a location in the root of the repository, meaning that it would result in ignoring a folder of that name at any location in the project. In cases like this where a specific path is known, it is best to configure that exact path in order to avoid any chance of unexpected behavior. --- .markdownlintignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.markdownlintignore b/.markdownlintignore index 0022748d..6cec4c9e 100644 --- a/.markdownlintignore +++ b/.markdownlintignore @@ -1,4 +1,4 @@ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown/.markdownlintignore -.licenses/ +/.licenses/ __pycache__/ node_modules/