From f22e4e39f5849e0f1694aa5b8ebb4dfd9a5034cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Mar 2023 11:38:54 +0100 Subject: [PATCH 01/14] Bump actions/setup-go from 3 to 4 (#30) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check-go-dependencies-task.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index be478ab..7eb19d1 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -76,7 +76,7 @@ jobs: version: 3.x - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} @@ -126,7 +126,7 @@ jobs: version: 3.x - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} From da40cc4e52da01f03f0692c28081b4d079490e51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:58:49 +0000 Subject: [PATCH 02/14] Bump actions/checkout from 3 to 4 Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-go-dependencies-task.yml | 4 ++-- .github/workflows/check-license.yml | 2 +- .github/workflows/check-markdown-task.yml | 4 ++-- .github/workflows/check-taskfiles.yml | 2 +- .github/workflows/sync-labels.yml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index 7eb19d1..0af4d2d 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -65,7 +65,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive @@ -115,7 +115,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive diff --git a/.github/workflows/check-license.yml b/.github/workflows/check-license.yml index 77c6d18..9fcd4cf 100644 --- a/.github/workflows/check-license.yml +++ b/.github/workflows/check-license.yml @@ -63,7 +63,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Ruby uses: ruby/setup-ruby@v1 diff --git a/.github/workflows/check-markdown-task.yml b/.github/workflows/check-markdown-task.yml index 9b53c3a..8587170 100644 --- a/.github/workflows/check-markdown-task.yml +++ b/.github/workflows/check-markdown-task.yml @@ -69,7 +69,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v3 @@ -95,7 +95,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/check-taskfiles.yml b/.github/workflows/check-taskfiles.yml index cc41d93..8c86550 100644 --- a/.github/workflows/check-taskfiles.yml +++ b/.github/workflows/check-taskfiles.yml @@ -39,7 +39,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v3 diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 70085bd..9134495 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -27,7 +27,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download JSON schema for labels configuration file id: download-schema @@ -106,7 +106,7 @@ jobs: echo "::set-output name=flag::--dry-run" - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download configuration files artifact uses: actions/download-artifact@v3 From 348fa6aae1bb1b7f2ffdf12ef7e2b09bcb54b4b3 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 12 Oct 2023 16:36:08 +0200 Subject: [PATCH 03/14] ExtractSubIndexLists now allows non-sequential elements --- properties.go | 47 ++++++++++++++++++++++++++++++++++++---------- properties_test.go | 38 +++++++++++++++---------------------- 2 files changed, 52 insertions(+), 33 deletions(-) diff --git a/properties.go b/properties.go index b7cccb6..216fdee 100644 --- a/properties.go +++ b/properties.go @@ -76,6 +76,8 @@ import ( "reflect" "regexp" "runtime" + "sort" + "strconv" "strings" "unicode/utf8" @@ -630,6 +632,9 @@ func (m *Map) ExtractSubIndexSets(root string) []*Map { // "tre.discovery.required.1": "itemA", // "tre.discovery.required.2": "itemB", // "tre.discovery.required.3": "itemC", +// "quattro.discovery.required.1": "itemA", +// "quattro.discovery.required.4": "itemB", +// "quattro.discovery.required.5": "itemC", // } // // calling ExtractSubIndexLists("uno.discovery.required") returns the array: @@ -644,23 +649,45 @@ func (m *Map) ExtractSubIndexSets(root string) []*Map { // // [ "itemA", "itemB", "itemC" ] // +// also the list may contains holes, so calling ExtractSubIndexLists("quattro.discovery.required") returns: +// +// [ "itemA", "itemB", "itemC" ] +// // Numeric subindex cannot be mixed with non-numeric, in that case only the numeric sub // index sets will be returned. func (m *Map) ExtractSubIndexLists(root string) []string { - // First check the properties with numeric sub index "root.N.xxx" + isNotDigit := func(in string) bool { + for _, r := range in { + if r < '0' || r > '9' { + return true + } + } + return false + } + + // Extract numeric keys + subProps := m.SubTree(root) + indexes := []int{} + for _, key := range subProps.o { + if isNotDigit(key) { + continue + } + if idx, err := strconv.Atoi(key); err == nil { + indexes = append(indexes, idx) + } + } + sort.Ints(indexes) + res := []string{} - portIDPropsSet := m.SubTree(root) - idx := 0 haveIndexedProperties := false - for { - k := fmt.Sprintf("%d", idx) - idx++ - if v, ok := portIDPropsSet.GetOk(k); ok { + for i, idx := range indexes { + if i > 0 && idx == indexes[i-1] { + // de-duplicate cases like "05" and "5" + continue + } + if v, ok := subProps.GetOk(strconv.Itoa(idx)); ok { haveIndexedProperties = true res = append(res, v) - } else if idx > 1 { - // Always check sub-id 0 and 1 (https://github.com/arduino/arduino-cli/issues/456) - break } } diff --git a/properties_test.go b/properties_test.go index 1283c64..16a4c01 100644 --- a/properties_test.go +++ b/properties_test.go @@ -357,32 +357,24 @@ func TestExtractSubIndexLists(t *testing.T) { "quattro.discovery.required.1": "itemB", "quattro.discovery.required.2": "itemC", "cinque.discovery.something": "itemX", + "sei.discovery.something.1": "itemA", + "sei.discovery.something.2": "itemB", + "sei.discovery.something.5": "itemC", + "sei.discovery.something.12": "itemD", + "sette.discovery.something.01": "itemA", + "sette.discovery.something.2": "itemB", + "sette.discovery.something.05": "itemC", + "sette.discovery.something.5": "itemD", } m := NewFromHashmap(data) - s1 := m.ExtractSubIndexLists("uno.discovery.required") - require.Len(t, s1, 1) - require.Equal(t, s1[0], "item") - - s2 := m.ExtractSubIndexLists("due.discovery.required") - require.Len(t, s2, 3) - require.Equal(t, s2[0], "item1") - require.Equal(t, s2[1], "item2") - require.Equal(t, s2[2], "item3") - - s3 := m.ExtractSubIndexLists("tre.discovery.required") - require.Len(t, s3, 3) - require.Equal(t, s3[0], "itemA") - require.Equal(t, s3[1], "itemB") - require.Equal(t, s3[2], "itemC") - - s4 := m.ExtractSubIndexLists("quattro.discovery.required") - require.Len(t, s4, 2) - require.Equal(t, s4[0], "itemB") - require.Equal(t, s4[1], "itemC") - - s5 := m.ExtractSubIndexLists("cinque.discovery.required") - require.Len(t, s5, 0) + require.Equal(t, []string{"item"}, m.ExtractSubIndexLists("uno.discovery.required")) + require.Equal(t, []string{"item1", "item2", "item3"}, m.ExtractSubIndexLists("due.discovery.required")) + require.Equal(t, []string{"itemA", "itemB", "itemC"}, m.ExtractSubIndexLists("tre.discovery.required")) + require.Equal(t, []string{"itemB", "itemC"}, m.ExtractSubIndexLists("quattro.discovery.required")) + require.Equal(t, []string{}, m.ExtractSubIndexLists("cinque.discovery.required")) + require.Equal(t, []string{"itemA", "itemB", "itemC", "itemD"}, m.ExtractSubIndexLists("sei.discovery.something")) + require.Equal(t, []string{"itemB", "itemD"}, m.ExtractSubIndexLists("sette.discovery.something")) } func TestLoadingNonUTF8Properties(t *testing.T) { From 03d5684e89a1c0f40b345061f9e7944a8fbf7ed3 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 12 Oct 2023 16:58:16 +0200 Subject: [PATCH 04/14] Update check-taskfile workflow --- .github/workflows/check-taskfiles.yml | 33 +++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-taskfiles.yml b/.github/workflows/check-taskfiles.yml index 8c86550..b9a65e4 100644 --- a/.github/workflows/check-taskfiles.yml +++ b/.github/workflows/check-taskfiles.yml @@ -7,6 +7,7 @@ env: # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows on: + create: push: paths: - ".github/workflows/check-taskfiles.ya?ml" @@ -26,9 +27,37 @@ on: repository_dispatch: jobs: + run-determination: + runs-on: ubuntu-latest + permissions: {} + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if the rest of the workflow should run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. + if [[ + "${{ github.event_name }}" != "create" || + "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX + ]]; then + # Run the other jobs. + RESULT="true" + else + # There is no need to run the other jobs. + RESULT="false" + fi + + echo "result=$RESULT" >> $GITHUB_OUTPUT + validate: name: Validate ${{ matrix.file }} + needs: run-determination + if: needs.run-determination.outputs.result == 'true' runs-on: ubuntu-latest + permissions: + contents: read strategy: fail-fast: false @@ -50,8 +79,8 @@ jobs: id: download-schema uses: carlosperate/download-file-action@v2 with: - # See: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json - file-url: https://json.schemastore.org/taskfile.json + # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json + file-url: https://taskfile.dev/schema.json location: ${{ runner.temp }}/taskfile-schema - name: Install JSON schema validator From 70c55c7aa55cf1697f226cdd49bcd48baf85cad5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 10:58:55 +0000 Subject: [PATCH 05/14] Bump actions/setup-node from 3 to 4 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-markdown-task.yml | 4 ++-- .github/workflows/check-taskfiles.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-markdown-task.yml b/.github/workflows/check-markdown-task.yml index 8587170..22aea65 100644 --- a/.github/workflows/check-markdown-task.yml +++ b/.github/workflows/check-markdown-task.yml @@ -72,7 +72,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} @@ -98,7 +98,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} diff --git a/.github/workflows/check-taskfiles.yml b/.github/workflows/check-taskfiles.yml index b9a65e4..d369f69 100644 --- a/.github/workflows/check-taskfiles.yml +++ b/.github/workflows/check-taskfiles.yml @@ -71,7 +71,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} From 611a09ab77550cb8deb02f48a9662ce301ad8b51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Dec 2023 11:02:35 +0000 Subject: [PATCH 06/14] Bump actions/setup-go from 4 to 5 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-go-dependencies-task.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index 0af4d2d..0a368eb 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -76,7 +76,7 @@ jobs: version: 3.x - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} @@ -126,7 +126,7 @@ jobs: version: 3.x - name: Install Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} From f260d7b0be3c6ad3f7bcdc942972a9f86c4db6b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:45:22 +0000 Subject: [PATCH 07/14] Bump arduino/setup-task from 1 to 2 Bumps [arduino/setup-task](https://github.com/arduino/setup-task) from 1 to 2. - [Release notes](https://github.com/arduino/setup-task/releases) - [Commits](https://github.com/arduino/setup-task/compare/v1...v2) --- updated-dependencies: - dependency-name: arduino/setup-task dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-go-dependencies-task.yml | 4 ++-- .github/workflows/check-markdown-task.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index 0a368eb..c5ff500 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -81,7 +81,7 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x @@ -131,7 +131,7 @@ jobs: go-version: ${{ env.GO_VERSION }} - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x diff --git a/.github/workflows/check-markdown-task.yml b/.github/workflows/check-markdown-task.yml index 22aea65..d172c17 100644 --- a/.github/workflows/check-markdown-task.yml +++ b/.github/workflows/check-markdown-task.yml @@ -80,7 +80,7 @@ jobs: uses: xt0rted/markdownlint-problem-matcher@v2 - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x @@ -103,7 +103,7 @@ jobs: node-version: ${{ env.NODE_VERSION }} - name: Install Task - uses: arduino/setup-task@v1 + uses: arduino/setup-task@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: 3.x From 69cb83e785205f7dfe401c53fc6e247c9ed12f1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 10:35:43 +0000 Subject: [PATCH 08/14] Bump xt0rted/markdownlint-problem-matcher from 2 to 3 Bumps [xt0rted/markdownlint-problem-matcher](https://github.com/xt0rted/markdownlint-problem-matcher) from 2 to 3. - [Release notes](https://github.com/xt0rted/markdownlint-problem-matcher/releases) - [Changelog](https://github.com/xt0rted/markdownlint-problem-matcher/blob/main/CHANGELOG.md) - [Commits](https://github.com/xt0rted/markdownlint-problem-matcher/compare/v2...v3) --- updated-dependencies: - dependency-name: xt0rted/markdownlint-problem-matcher dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-markdown-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-markdown-task.yml b/.github/workflows/check-markdown-task.yml index d172c17..5f2a772 100644 --- a/.github/workflows/check-markdown-task.yml +++ b/.github/workflows/check-markdown-task.yml @@ -77,7 +77,7 @@ jobs: node-version: ${{ env.NODE_VERSION }} - name: Initialize markdownlint-cli problem matcher - uses: xt0rted/markdownlint-problem-matcher@v2 + uses: xt0rted/markdownlint-problem-matcher@v3 - name: Install Task uses: arduino/setup-task@v2 From 9ea886b5ffa257b4938d16099276ed92e2cd46e9 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 4 Jun 2024 16:38:13 +0200 Subject: [PATCH 09/14] SplitQuotedString always returns a result If the function finds an opening quote character and does not find the closing quote character, it will return an error. Previously, in case of error, the returned split array was always empty. Now, in any case, the function will return the split array up to the point where the error occurred. --- strings.go | 26 +++++++++++++++++++++++--- strings_test.go | 11 +++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/strings.go b/strings.go index f64b15e..4eae333 100644 --- a/strings.go +++ b/strings.go @@ -39,9 +39,29 @@ import ( // to use spaces in a single element of the split using quote characters. // // For example the call: -// SplitQuotedString(`This 'is an' "Hello World!" example`, `'"`, false) +// +// SplitQuotedString(`This 'is an' "Hello World!" example`, `'"`, false) +// // returns the following array: -// []string{"This", "is an", "Hello World!", "example"} +// +// []string{"This", "is an", "Hello World!", "example"} +// +// The quoteChars parameter is a string containing all the characters that +// are considered as quote characters. If a quote character is found, the +// function will consider the text between the quote character and the next +// quote character as a single element of the split. +// +// The acceptEmptyArguments parameter is a boolean that indicates if the +// function should consider empty arguments as valid elements of the split. +// If set to false, the function will ignore empty arguments. +// +// If the function finds an opening quote character and does not find the +// closing quote character, it will return an error. In any case, the function +// will return the split array up to the point where the error occurred. +// +// The function does not support escaping of quote characters. +// +// The function is UTF-8 safe. func SplitQuotedString(src string, quoteChars string, acceptEmptyArguments bool) ([]string, error) { // Make a map of valid quote runes isQuote := map[rune]bool{} @@ -83,7 +103,7 @@ func SplitQuotedString(src string, quoteChars string, acceptEmptyArguments bool) } if escapingChar != 0 { - return nil, fmt.Errorf("invalid quoting, no closing `%c` char found", escapingChar) + return result, fmt.Errorf("invalid quoting, no closing `%c` char found", escapingChar) } return result, nil diff --git a/strings_test.go b/strings_test.go index 2f5319d..9245f04 100644 --- a/strings_test.go +++ b/strings_test.go @@ -64,8 +64,11 @@ func TestSplitQuotedStringWithUTF8(t *testing.T) { } func TestSplitQuotedStringInvalid(t *testing.T) { - _, err := SplitQuotedString(`'this is' a 'test of quoting`, `"'`, true) - require.Error(t, err) - _, err = SplitQuotedString(`'this is' a "'test" of "quoting`, `"'`, true) - require.Error(t, err) + res, err := SplitQuotedString(`'this is' a 'test of quoting`, `"'`, true) + require.EqualError(t, err, "invalid quoting, no closing `'` char found") + require.Equal(t, res, []string{"this is", "a"}) + + res, err = SplitQuotedString(`'this is' a "'test" of "quoting`, `"'`, true) + require.EqualError(t, err, "invalid quoting, no closing `\"` char found") + require.Equal(t, res, []string{"this is", "a", "'test", "of"}) } From 7515f2dd7c238320635da8bdb459c2623d2d0e15 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 3 Sep 2024 12:33:30 -0700 Subject: [PATCH 10/14] Configure actions/upload-artifact action to upload required hidden files A breaking change was made in the 3.2.1 release of the "actions/upload-artifact" action, without doing a major version bump as would be done in a responsibly maintained project. The action now defaults to not uploading "hidden" files. This project's "Check Go Dependencies" workflow uses the "Licensed" tool to check for incompatible dependency licenses. The dependencies license metadata cache used by Licensed is stored in a folder named `.licensed`. In order to facilitate updates, the workflow uploads the generated dependencies license metadata cache as a workflow artifact when the current cache is found to be outdated. The `.` at the start of the `.licensed` folder name causes it to now not be uploaded to the workflow artifact. In order to catch such problems, the workflow configures the "actions/upload-artifact" action to fail if no files were uploaded. So in addition to not uploading the artifact, the change in the "actions/upload-artifact" action's behavior also resulted in the workflow runs failing: Error: No files were found with the provided path: .licenses/. No artifacts will be uploaded. The problem is fixed by disabling the "actions/upload-artifact" action's new behavior via the `include-hidden-files` input. After this change, the workflow can once more upload the dependencies license metadata cache to a workflow artifact as needed. --- .github/workflows/check-go-dependencies-task.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index c5ff500..ec1469a 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -105,6 +105,7 @@ jobs: uses: actions/upload-artifact@v3 with: if-no-files-found: error + include-hidden-files: true name: dep-licenses-cache path: .licenses/ From dab28eb5f1629c879c247b1739ab52e3d14dbe1c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 08:37:13 +0000 Subject: [PATCH 11/14] Bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-go-dependencies-task.yml | 2 +- .github/workflows/sync-labels.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-go-dependencies-task.yml b/.github/workflows/check-go-dependencies-task.yml index ec1469a..6cb341d 100644 --- a/.github/workflows/check-go-dependencies-task.yml +++ b/.github/workflows/check-go-dependencies-task.yml @@ -102,7 +102,7 @@ jobs: # Some might find it convenient to have CI generate the cache rather than setting up for it locally - name: Upload cache to workflow artifact if: failure() && steps.diff.outcome == 'failure' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: if-no-files-found: error include-hidden-files: true diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 9134495..e1b8658 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -71,7 +71,7 @@ jobs: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} - name: Pass configuration files to next job via workflow artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: | *.yaml From 85a79edadcf85c091c59d28036655cf1ae5cb478 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:48:46 +0000 Subject: [PATCH 12/14] Bump actions/download-artifact from 3 to 4 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index e1b8658..34ff6a5 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -109,7 +109,7 @@ jobs: uses: actions/checkout@v4 - name: Download configuration files artifact - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} path: ${{ env.CONFIGURATIONS_FOLDER }} From 053c17bfe3638c218fd36ef1dd182ada5e742322 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 10:49:17 +0000 Subject: [PATCH 13/14] Bump geekyeggo/delete-artifact from 2 to 5 Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 2 to 5. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v2...v5) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 34ff6a5..e73db2e 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -115,7 +115,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v5 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From 382cd904cf251c4d9f57a524b269d1ded02ec22c Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 20 Oct 2024 05:39:17 -0700 Subject: [PATCH 14/14] Don't upload multiple times to same artifact in label sync workflow The "Sync Labels" GitHub Actions workflow is configured to allow the use of multiple shared label configuration files. This is done by using a job matrix in the GitHub Actions workflow to download each of the files from the source repository in a parallel GitHub Actions workflow job. A GitHub Actions workflow artifact was used to transfer the generated files between sequential jobs in the workflow. The "actions/upload-artifact" and "actions/download-artifact" actions are used for this purpose. Previously, a single artifact was used for the transfer of all the shared label configuration files, with each of the parallel jobs uploading its own generated files to that artifact. However, support for uploading multiple times to a single artifact was dropped in version 4.0.0 of the "actions/upload-artifact" action. So it is now necessary to use a dedicated artifact for each of the builds. These can be downloaded in aggregate by using the artifact name globbing and merging features which were introduced in version 4.1.0 of the "actions/download-artifact" action. --- .github/workflows/sync-labels.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index e73db2e..78723a3 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -19,7 +19,7 @@ on: env: CONFIGURATIONS_FOLDER: .github/label-configuration-files - CONFIGURATIONS_ARTIFACT: label-configuration-files + CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file- jobs: check: @@ -77,7 +77,7 @@ jobs: *.yaml *.yml if-no-files-found: error - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }} sync: needs: download @@ -108,16 +108,17 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Download configuration files artifact + - name: Download configuration file artifacts uses: actions/download-artifact@v4 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + merge-multiple: true + pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* path: ${{ env.CONFIGURATIONS_FOLDER }} - - name: Remove unneeded artifact + - name: Remove unneeded artifacts uses: geekyeggo/delete-artifact@v5 with: - name: ${{ env.CONFIGURATIONS_ARTIFACT }} + name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* - name: Merge label configuration files run: |