From 95b7eff39a6faeb6e1d633a98887f725de505bd0 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Thu, 25 Jul 2024 12:24:59 +0200 Subject: [PATCH] add example workflow that updates to latest version the tasks/actions --- .github/workflows/examples-version.yml | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/examples-version.yml diff --git a/.github/workflows/examples-version.yml b/.github/workflows/examples-version.yml new file mode 100644 index 0000000..2b4d9c6 --- /dev/null +++ b/.github/workflows/examples-version.yml @@ -0,0 +1,31 @@ +name: Update examples version + +on: + repository_dispatch: + types: [ update-examples ] + +defaults: + run: + shell: pwsh + +jobs: + update-examples-version: + if: ${{ github.event_name == 'repository_dispatch' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.PUSH_GITHUB_TOKEN }} + - run: | + $oldTag = "${{ github.event.client_payload.oldTag }}" + $newTag = "${{ github.event.client_payload.newTag }}" + + dir -r .github\**\*.yml | % { update-md-files $_ -OldVersion $oldTag -NewVersion $newTag } + dir -r .azure\**\*.yml | % { update-md-files $_ -OldVersion $oldTag -NewVersion $newTag } + + git add --verbose . + git config user.name 'Artur Stolear' + git config user.email 'artur.stolear@gmail.com' + git commit -m "update examples version to $newTag" --allow-empty + git push --force + name: Update examples version