forked from dfinity/oisy-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.34 KB
/
frontend-remove-unused-components.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: Remove Unused Svelte Files
on:
schedule:
- cron: '30 3 * * MON'
workflow_dispatch:
jobs:
check-unused-files:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
uses: ./.github/actions/prepare
- name: Remove unused files
run: ./scripts/check.unused.sh --remove-files
continue-on-error: true
- name: Stage Changes
run: git add .
- name: Check for Changes
run: |
if ! git diff --cached --quiet; then
echo "CHANGES_DETECTED=true" >> $GITHUB_ENV
DELETED_FILES=$(git diff --cached --name-only)
echo "DELETED_FILES<<EOF" >> $GITHUB_ENV
echo "$DELETED_FILES" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
fi
# This action creates a PR only if there are changes.
- name: Create Pull Request
if: env.CHANGES_DETECTED == 'true'
uses: ./.github/actions/create-pr
with:
token: ${{ secrets.GIX_CREATE_PR_PAT }}
branch: bot-frontend-remove-unused-svelte-files
title: 'chore(frontend): Remove Unused Svelte Files'
body: |
The following files were removed because they were not used in the project anymore:
```
${{ env.DELETED_FILES }}
```