Refactor copy_change workflow to use matrix strategy

This commit is contained in:
Jason2866 2025-12-14 14:07:01 +01:00 committed by GitHub
parent c06dfcffa1
commit 67934fbe81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,33 +9,27 @@ on:
- 'I2CDEVICES.md' - 'I2CDEVICES.md'
jobs: jobs:
copy_change: copy_change:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'arendst/Tasmota' if: github.repository == 'arendst/Tasmota'
strategy:
matrix:
file:
- name: 'I2CDEVICES.md'
message: 'I2CDevices.md changed'
- name: 'BUILDS.md'
message: 'Builds.md changed'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Push I2CDevices.md to https://github.com/Tasmota/docs - name: Push ${{ matrix.file.name }} to docs repo
uses: Jason2866/copy_file_to_another_repo_action@main uses: Jason2866/copy_file_to_another_repo_action@main
env: env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with: with:
source_file: 'I2CDEVICES.md' source_file: ${{ matrix.file.name }}
destination_repo: 'Tasmota/docs' destination_repo: 'Tasmota/docs'
destination_branch: 'development' destination_branch: 'development'
destination_folder: 'docs' destination_folder: 'docs'
user_email: 'github-actions@github.com' user_email: 'github-actions@github.com'
user_name: 'github-actions' user_name: 'github-actions'
commit_message: 'I2CDevices.md changed' commit_message: ${{ matrix.file.message }}
- name: Push Builds.md to https://github.com/Tasmota/docs
uses: Jason2866/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'BUILDS.md'
destination_repo: 'Tasmota/docs'
destination_branch: 'development'
destination_folder: 'docs'
user_email: 'github-actions@github.com'
user_name: 'github-actions'
commit_message: 'Builds.md changed'