Skip to content

Commit 529f281

Browse files
committed
Fix date usage
For reference: - https://unix.stackexchange.com/questions/162607/date-command-going-back-one-or-two-days-seeing-different-flags - https://pubs.opengroup.org/onlinepubs/9699919799/utilities/date.html In short, OSX has a convenient `-v` option which is not in the POSIX standard, while the Ubuntu `date` has a `--date` option.
1 parent c68ebc4 commit 529f281

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/npm_downloads.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- name: 'Fetch data'
6565
id: download_data
6666
run: |
67-
url="https://api.npmjs.org/downloads/range/$(date -v-1y '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}"
67+
url="https://api.npmjs.org/downloads/range/$(date --date='1 year ago' '+%Y-%m-%d'):$(date '+%Y-%m-%d')/${{ steps.package_name.outputs.package_name }}"
6868
echo "$url"
6969
data=$(curl "$url")
7070
mkdir ./tmp

0 commit comments

Comments
 (0)