-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpatch.yml
47 lines (41 loc) · 1.45 KB
/
patch.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: patch
# version: 1.0.1
# author: [yiXu](https://github.com/yi-Xu-0100)
# guide: [yi-Xu-0100/hub-mirror](https://github.com/yi-Xu-0100/hub-mirror)
# template: [patch.yml](https://github.com/yi-Xu-0100/hub-mirror/blob/main/template/patch.yml)
# lastmod: 2021-01-29 23:07:11
on:
workflow_dispatch:
inputs:
repo:
description: 'Directory need to delete'
required: false
default: ''
jobs:
run:
name: Delete the wrong cache directory
runs-on: ubuntu-latest
steps:
- name: Get repo and time
id: info
uses: actions/[email protected]
with:
result-encoding: string
script: |
core.setOutput('time', new Date(Date.now()).toISOString().replace(/[^0-9]/g, ""));
core.setOutput('key', `${context.repo.owner}-${context.repo.repo}`);
- name: Cache src repos
uses: actions/[email protected]
id: cache
with:
path: ${{ github.workspace }}/hub-mirror-cache
key: ${{ runner.os }}-${{ steps.info.outputs.key }}-list-cache-${{ steps.info.outputs.time }}
restore-keys: ${{ runner.os }}-${{ steps.info.outputs.key }}-list-
- name: Delete the wrong cache directory
run: |
cd ${{ github.workspace }}/hub-mirror-cache/
ls -la ./
rm -rf ${{ github.event.inputs.repo }}/
- name: Print cache path
run: |
ls -la ${{ github.workspace }}/hub-mirror-cache