-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (34 loc) · 1.25 KB
/
initialize-providers.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
### Note: This implementation should be changed to use `go run main.go update`, as it should only look for new releases for tags
### For now, it uses `go run main.go initialize` which initializes a provider/module from scratch
name: Synchronize Providers and Modules
on:
schedule:
- cron: '5 * * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
name: Update
permissions: write-all
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Install Go
uses: actions/setup-go@v4
- name: Find all files
id: list-files
run: |
files=$(find providers/ modules/ -type f -name "*.json" -exec printf "%s," {} + | sed 's/,$//')
echo "files=$files" >> $GITHUB_OUTPUT
- name: Initialize files
run: go run ./cmd/main.go update ${{ steps.list-files.outputs.files }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: 'modules/**/* providers/**/*'
- name: Invoke publish workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-files.yml # TODO apply commit message here