Synchronize Providers and Modules #8980
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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 |