-
Notifications
You must be signed in to change notification settings - Fork 5
50 lines (44 loc) · 1.56 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
48
49
50
name: patch
# version: 1.0.0
# 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: 2020-12-30 21:58:51
on:
workflow_dispatch:
inputs:
repo:
description: 'Directory need to delete'
required: false
default: 'Application-Lists'
jobs:
run:
name: Delete the wrong cache directory
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Get repo and time
id: info
uses: actions/github-script@v6
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}`);
return context.repo.repo;
- name: Cache src repos
uses: actions/cache@v3
id: cache
with:
path: ${{ github.workspace }}/hub-mirror-cache
key: ${{ runner.os }}-${{ steps.info.outputs.key }}-cache-${{ steps.info.outputs.time }}
restore-keys: ${{ runner.os }}-${{ steps.info.outputs.key }}-cache-
- 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