Skip to content

Remove Expired Refs #171

Remove Expired Refs

Remove Expired Refs #171

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@v4
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 "[email protected]"
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