FantasticFiasco / action-update-license-year

GitHub Action that in a pull request updates the copyright year(s) in your license file.
Apache License 2.0
59 stars 2 forks source link

several coprights on the same file - only first is update #333

Closed glimchb closed 1 year ago

glimchb commented 1 year ago

Describe the bug

Example of file we have:

// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2022 Dell Inc, or its subsidiaries.
// Copyright (C) 2022 Marvell International Ltd.
// Copyright (C) 2022 Intel Corporation

code...

the resulted pull request:

// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2022-2023 Dell Inc, or its subsidiaries.
// Copyright (C) 2022 Marvell International Ltd.
// Copyright (C) 2022 Intel Corporation

code...

Expected behavior

// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2022-2023 Dell Inc, or its subsidiaries.
// Copyright (C) 2022-2023 Marvell International Ltd.
// Copyright (C) 2022-2023 Intel Corporation

code...
github-actions[bot] commented 1 year ago

Hi there and welcome to this repository!

A maintainer will be with you shortly, but first and foremost I would like to thank you for taking the time to report this issue. Quality is of the highest priority for us, and we would never release anything with known defects. We aim to do our best but unfortunately you are here because you encountered something we didn't expect. Lets see if we can figure out what went wrong and provide a remedy for it.

FantasticFiasco commented 1 year ago

Hi @glimchb! Thanks for reporting the issue, I'll look into it!

FantasticFiasco commented 1 year ago

@glimchb, would you be able to try a fix for your issue by updating your workflow to use FantasticFiasco/action-update-license-year@fix/transform-only-applied-once-per-file instead of FantasticFiasco/action-update-license-year@v2?

glimchb commented 1 year ago

thanks @FantasticFiasco !

unfortunately doesn't seem to work...

2023-03-28T13:33:41.8447179Z ##[group]Run FantasticFiasco/action-update-license-year@fix/transform-only-applied-once-per-file
2023-03-28T13:33:41.8447628Z with:
2023-03-28T13:33:41.8448133Z   token: ***
2023-03-28T13:33:41.8448460Z   path: Dockerfile
docker-compose.yml
./**/*.go

2023-03-28T13:33:41.8448831Z   branchName: license/copyright-to-{{currentYear}}
2023-03-28T13:33:41.8449201Z   commitTitle: docs(license): update copyright year(s)
2023-03-28T13:33:41.8449534Z   commitAuthorName: github-actions
2023-03-28T13:33:41.8449869Z   commitAuthorEmail: github-actions@github.com
2023-03-28T13:33:41.8450202Z   prTitle: Update license copyright year(s)
2023-03-28T13:33:41.8450485Z ##[endgroup]
2023-03-28T13:33:41.9737799Z Working directory: /home/runner/work/opi-nvidia-bridge/opi-nvidia-bridge
2023-03-28T13:33:41.9974900Z Current year is "2023"
2023-03-28T13:33:42.3955838Z Checkout new branch named "license/copyright-to-2023"
2023-03-28T13:33:42.4443037Z Found 11 file(s) matching the path "Dockerfile\ndocker-compose.yml\n./**/*.go"
2023-03-28T13:33:42.4460115Z File "./Dockerfile" is already up-to-date
2023-03-28T13:33:42.4465251Z File "./cmd/main.go" is already up-to-date
2023-03-28T13:33:42.4470026Z File "./docker-compose.yml" is already up-to-date
2023-03-28T13:33:42.4474710Z File "./pkg/frontend/frontend.go" is already up-to-date
2023-03-28T13:33:42.4480221Z File "./pkg/frontend/frontend_test.go" is already up-to-date
2023-03-28T13:33:42.4486946Z File "./pkg/frontend/nvme.go" is already up-to-date
2023-03-28T13:33:42.4497072Z File "./pkg/frontend/nvme_test.go" is already up-to-date
2023-03-28T13:33:42.4502854Z File "./pkg/frontend/spdk_test.go" is already up-to-date
2023-03-28T13:33:42.4509008Z File "./pkg/frontend/virtio.go" is already up-to-date
2023-03-28T13:33:42.4517903Z File "./pkg/frontend/virtio_test.go" is already up-to-date
2023-03-28T13:33:42.4523746Z File "./pkg/models/spdk.go" is already up-to-date
2023-03-28T13:33:42.4524151Z No licenses were updated, let's abort
2023-03-28T13:33:42.4649200Z Post job cleanup.

where:

$ head pkg/frontend/frontend.go
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries.
// Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// Copyright (C) 2023 Intel Corporation
FantasticFiasco commented 1 year ago

Dang, didn't think of the situation where we'd have a mix of YYYY and YYYY-YYYY, should be fixed now. Would you be able to trigger another run?

glimchb commented 1 year ago

@FantasticFiasco works like a charm now! thanks for such great support and quick fix

FantasticFiasco commented 1 year ago

I'll create a new release in the upcoming days, will let you know. Thanks again for reporting the issue!

glimchb commented 1 year ago

thanks @FantasticFiasco ! my @renovate-bot will pick it up