-
Notifications
You must be signed in to change notification settings - Fork 10
64 lines (60 loc) · 1.92 KB
/
updateStringInRepos.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Update string
on:
workflow_dispatch:
inputs:
query:
description: 'Query from github API'
default: 'topic:x'
required: true
org:
description: 'Org to search for repos in'
default: 'DSACMS'
required: true
find:
description: 'String to search for'
default: 'x'
required: true
replace:
description: 'Replacement string'
default: 'y'
required: true
file:
description: 'File to replace in'
default: 'CONTRIBUTING.md'
env:
repo: ""
jobs:
find-repos:
runs-on: ubuntu-latest
name: Find repos and generate matrix
steps:
- name: Checkout Action
uses: actions/checkout@v4
- name: Find repos
uses: ./.github/findRepos
with:
query: ${{ github.event.inputs.query }}
org: ${{ github.event.inputs.org }}
token: ${{ secrets.pat }}
outputs:
matrix: ${{ env.repo }}
update:
runs-on: ubuntu-latest
name: Update file
needs: [find-repos]
strategy:
matrix:
repo: ${{ fromJSON(needs.find-repos.outputs.matrix ) }}
steps:
- name: Checkout Action
uses: actions/checkout@v4
- name: Update file
uses: ./.github/fileUpdater
with:
repository: ${{ matrix.repo }}
find: ${{ github.event.inputs.find }}
replace: ${{ github.event.inputs.replace }}
file: ${{ github.event.inputs.file }}
token: ${{ secrets.pat }}
- name: Checkout Action again to stop post error
uses: actions/checkout@v4