From a14ad5efd569c190a4cc75a2355c3826e08738db Mon Sep 17 00:00:00 2001 From: malinkang Date: Sat, 13 Jan 2024 13:51:38 +0800 Subject: [PATCH] add year --- .github/workflows/weread.yml | 7 ++++++- test.sh | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 test.sh diff --git a/.github/workflows/weread.yml b/.github/workflows/weread.yml index 047df7bb71b..82f624c88e9 100644 --- a/.github/workflows/weread.yml +++ b/.github/workflows/weread.yml @@ -8,6 +8,8 @@ jobs: sync: name: Sync runs-on: ubuntu-latest + env: + YEAR: ${{ vars.YEAR }} steps: - name: Checkout uses: actions/checkout@v3 @@ -23,9 +25,12 @@ jobs: - name: weread sync run: | python scripts/weread.py "${{secrets.WEREAD_COOKIE}}" "${{secrets.NOTION_TOKEN}}" "${{secrets.NOTION_DATABASE_ID}}" "${{ github.ref }}" "${{ github.repository }}" --styles 0 1 2 --colors 0 1 2 3 4 5 + - name: Set default year if not provided + run: echo "YEAR=$(date +"%Y")" >> $GITHUB_ENV + if: env.YEAR == '' - name: weread heatmap run: | - github_heatmap weread --weread_cookie "${{secrets.WEREAD_COOKIE}}" --year $(date +"%Y") --me "${{secrets.NAME}}" --with-animation --background-color=${{ vars.background_color||'#FFFFFF'}} --track-color=${{ vars.track_color||'#ACE7AE'}} --special-color1=${{ vars.special_color||'#69C16E'}} --special-color2=${{ vars.special_color2||'#549F57'}} --dom-color=${{ vars.dom_color||'#EBEDF0'}} --text-color=${{ vars.text_color||'#000000'}} + github_heatmap weread --weread_cookie "${{secrets.WEREAD_COOKIE}}" --year $YEAR --me "${{secrets.NAME}}" --with-animation --background-color=${{ vars.background_color||'#FFFFFF'}} --track-color=${{ vars.track_color||'#ACE7AE'}} --special-color1=${{ vars.special_color||'#69C16E'}} --special-color2=${{ vars.special_color2||'#549F57'}} --dom-color=${{ vars.dom_color||'#EBEDF0'}} --text-color=${{ vars.text_color||'#000000'}} - name: push run: | git config --local user.email "action@github.com" diff --git a/test.sh b/test.sh new file mode 100755 index 00000000000..9e44c716836 --- /dev/null +++ b/test.sh @@ -0,0 +1 @@ +echo $(date +"%Y") \ No newline at end of file