Skip to content

Commit

Permalink
Change the get time script (#68)
Browse files Browse the repository at this point in the history
Change the get time script to the same version with actions/cache example

[1] https://github.com/actions/cache
  • Loading branch information
Yikun authored Oct 28, 2020
1 parent f8921e1 commit 7dc4e3f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/verify-on-ubuntu-user-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v1

- name: Get time
id: info
uses: actions/github-script@v3.0.0
with:
result-encoding: string
script: |
return new Date(Date.now()).toISOString().replace(/[^0-9]/g, "");
- name: Get Time
id: get-time
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d%H%M%S")"
shell: bash

- name: Cache src repos
uses: actions/cache@v1
id: cache
with:
path: ${{ github.workspace }}/hub-mirror-cache
key: ${{ runner.os }}-yikun-hub-cache-${{ steps.info.outputs.result }}
restore-keys: ${{ runner.os }}-yikun-hub-cache
key: ${{ runner.os }}-repos-cache-${{ steps.get-time.outputs.date }}
restore-keys: ${{ runner.os }}-repos-cache

- name: Mirror Github to Gitee with white list and cache
uses: ./.
Expand Down

0 comments on commit 7dc4e3f

Please sign in to comment.