-
Notifications
You must be signed in to change notification settings - Fork 42
44 lines (35 loc) · 1.16 KB
/
remove_expired.yml
File metadata and controls
44 lines (35 loc) · 1.16 KB
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
name: Remove Expired Refs
on:
schedule:
- cron: "4 2 * * *"
pull_request:
paths:
- ".github/workflows/remove_expired.yml"
workflow_dispatch:
permissions: {}
jobs:
clean_up:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: true
# Use PAT so the commit triggers other actions
token: ${{ secrets.ALLOWLIST_WORKFLOW_TOKEN || github.token }}
- run: pip install ruyaml
- name: Clean actions.yml
shell: python
run: |
import sys
sys.path.append("./gateway/")
import gateway as g
g.clean_actions("actions.yml")
g.update_patterns("approved_patterns.yml", "actions.yml")
- name: Commit and push changes
if: ${{ github.event_name != 'pull_request' }}
run: |
git config --local user.name "asfgit"
git config --local user.email "asfgit@users.noreply.github.com"
git add -f actions.yml approved_patterns.yml
git commit -m "Remove Expired Refs" -m "Generated by .github/workflows/remove_expired.yml" || echo "No changes"
git push origin