-
Notifications
You must be signed in to change notification settings - Fork 175
48 lines (41 loc) · 1.38 KB
/
check-duplicate-images.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
name: Check-For-Duplicate-Image-Names
on:
schedule:
- cron: "0 2 * * 5"
workflow_dispatch:
jobs:
check-duplicate-images:
runs-on: ubuntu-latest
permissions:
contents: write
repository-projects: read
pull-requests: write
steps:
# Step 1: Check out the source code of the pull request.
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
# Step 2: Set up the Node.js environment.
- uses: actions/setup-node@v3
# Step 3: Check and renaming duplicate images
- name: Rename Duplicate Images
uses: mathiasvr/command-output@v1
id: check_and_fix_duplicate_names
with:
run: |
cd scripts/rename-duplicate-images
node rename-duplicate-images.js
# Step 4: Create PR for the changes
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Auto Rename Duplicate Images
title: Auto Rename Duplicate Images
body: Generated Automatically via GitHub Actions
base: main
branch: auto-rename-duplicate-images
delete-branch: true