Skip to content

Commit aed166e

Browse files
committed
build: explicitly set checkout path and handle missing files gracefully
1 parent 2d8aa35 commit aed166e

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/scripts/update_copyright_years

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ current_year=$(date +"%Y")
3030
directory_to_scan="${1:-.}"
3131

3232
for file in ${@}; do
33+
if [[ ! -f "$file" ]]; then
34+
echo "File not found: $file"
35+
continue
36+
fi
3337
echo "Updating copyright notice in $file..."
3438
if [[ "$OSTYPE" == "darwin"* ]]; then
3539
# macOS, where sed requires '' after -i to specify no backup...

.github/workflows/update_pr_copyright_years.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ jobs:
9494
# Token for accessing the repository:
9595
token: ${{ secrets.REPO_GITHUB_TOKEN }}
9696

97+
# File path to checkout to:
98+
path: './'
99+
97100
# Get list of added files:
98101
- name: 'Get list of added files'
99102
id: added-files

0 commit comments

Comments
 (0)