Skip to content

Commit fa918e4

Browse files
committed
Use standard position for non-configuration env mapping in workflow
In cases where some project-specific configuration of reusable GitHub Actions workflows must be done via workflow environment variables, the standard practice is to place the global `env` mapping near the top of the workflow to make them easily accessible to the project maintainer. However, in other cases the mapping does not contain any values that require adjustment. In this case, the established practice is to place it after the `on` mapping. Previously, the `env` mapping of the "Sync Labels" workflow was used to define the project's standard Node.js version, and thus the mapping was placed at the top of the workflow. However, this configuration was obviated by the change to defining the Node.js value in the `package.json` file. So the `env` mapping is no longer used for per-project configuration in this workflow and thus it should be moved below the `on` mapping.
1 parent f2e387d commit fa918e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/sync-labels-npm.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels-npm.md
22
name: Sync Labels
33

4-
env:
5-
CONFIGURATIONS_FOLDER: .github/label-configuration-files
6-
CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file-
7-
84
# See: https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows
95
on:
106
push:
@@ -27,6 +23,10 @@ on:
2723
workflow_dispatch:
2824
repository_dispatch:
2925

26+
env:
27+
CONFIGURATIONS_FOLDER: .github/label-configuration-files
28+
CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file-
29+
3030
jobs:
3131
check:
3232
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)