depup #139
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
name: depup | |
on: | |
schedule: | |
- cron: "14 14 * * *" | |
workflow_dispatch: | |
jobs: | |
generate-matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
files: ${{ steps.set-matrix.outputs.files }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Find matching README.adoc files | |
id: set-matrix | |
run: | | |
files=$(find ./docker-compose ./data-transforms -type f -name 'README.adoc' | jq -R -s -c 'split("\n") | map(select(length > 0))') | |
echo "files=${files}" >> "$GITHUB_OUTPUT" | |
reviewdog-redpanda: | |
needs: generate-matrix | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
file: ${{ fromJson(needs.generate-matrix.outputs.files) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run reviewdog depup on ${{ matrix.file }} | |
uses: reviewdog/action-depup@v1 | |
id: depup | |
with: | |
file: ${{ matrix.file }} | |
version_name: latest-redpanda-version | |
repo: redpanda-data/redpanda | |
- name: Sanitize and generate branch name | |
id: sanitize | |
run: | | |
# Sanitize the file path by removing invalid characters and replacing slashes and dots | |
sanitized_file=$(echo "${{ matrix.file }}" | sed 's/[\/\.]/-/g' | sed 's/[^a-zA-Z0-9\-]//g') | |
# Trim the path to keep it within a reasonable length | |
sanitized_file=$(echo "${sanitized_file}" | tail -c 50) | |
# Combine with version and timestamp for uniqueness | |
branch_name="depup/${sanitized_file}" | |
echo "branch_name=${branch_name}" >> "$GITHUB_ENV" | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
title: "chore(deps): update ${{ steps.depup.outputs.repo }} to ${{ steps.depup.outputs.latest }}" | |
commit-message: "chore(deps): update ${{ steps.depup.outputs.repo }} to ${{ steps.depup.outputs.latest }}" | |
body: | | |
Update ${{ steps.depup.outputs.repo }} to [${{ steps.depup.outputs.latest }}](https://github.com/${{ steps.depup.outputs.repo }}/releases/tag/v${{ steps.depup.outputs.latest }}) | |
This PR is auto generated by [depup workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3A${{ github.workflow }}). | |
branch: ${{ env.branch_name }} | |
reviewers: JakeSCahill | |
reviewdog-console: | |
needs: generate-matrix | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
file: ${{ fromJson(needs.generate-matrix.outputs.files) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run reviewdog depup on ${{ matrix.file }} | |
uses: reviewdog/action-depup@v1 | |
id: depup | |
with: | |
file: ${{ matrix.file }} | |
version_name: latest-console-version | |
repo: redpanda-data/console | |
- name: Sanitize and generate branch name | |
id: sanitize | |
run: | | |
# Sanitize the file path by removing invalid characters and replacing slashes and dots | |
sanitized_file=$(echo "${{ matrix.file }}" | sed 's/[\/\.]/-/g' | sed 's/[^a-zA-Z0-9\-]//g') | |
# Trim the path to keep it within a reasonable length | |
sanitized_file=$(echo "${sanitized_file}" | tail -c 50) | |
# Combine with version and timestamp for uniqueness | |
branch_name="depup/${sanitized_file}" | |
echo "branch_name=${branch_name}" >> "$GITHUB_ENV" | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
title: "chore(deps): update ${{ steps.depup.outputs.repo }} to ${{ steps.depup.outputs.latest }}" | |
commit-message: "chore(deps): update ${{ steps.depup.outputs.repo }} to ${{ steps.depup.outputs.latest }}" | |
body: | | |
Update ${{ steps.depup.outputs.repo }} to [${{ steps.depup.outputs.latest }}](https://github.com/${{ steps.depup.outputs.repo }}/releases/tag/v${{ steps.depup.outputs.latest }}) | |
This PR is auto generated by [depup workflow](https://github.com/${{ github.repository }}/actions?query=workflow%3A${{ github.workflow }}). | |
branch: ${{ env.branch_name }} | |
reviewers: JakeSCahill |