forked from SSWConsulting/SSW.Rules.Content
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.8 KB
/
check-duplicate-images.yml
File metadata and controls
55 lines (46 loc) · 1.8 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
45
46
47
48
49
50
51
52
53
54
55
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 }}
committer: SSW-Rules-Bot <rules-bot@example.com>
author: SSW-Rules-Bot <rules-bot@example.com>
commit-message: Auto Rename Duplicate Images
title: Auto Rename Duplicate Images
body: |
Generated automatically via GitHub Actions.
This PR was created because an automated check found multiple images with the same name in SSW.Rules.Content and tried to rename them.
The goal is to prevent incorrect images from being displayed on rules, see detail at https://www.github.com/SSWConsulting/SSW.Rules/issues/846
base: main
branch: auto-rename-duplicate-images
delete-branch: true