Skip to content

Manual and scheduled workflow to update dependencies #1103

Manual and scheduled workflow to update dependencies

Manual and scheduled workflow to update dependencies #1103

name: Manual and scheduled workflow to update dependencies
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
list-branches:
runs-on: ubuntu-latest
steps:
- uses: eProsima/eProsima-CI/external/checkout@v0
- id: list-branches
run: echo "branches=$(python3 .github/workflows/list_branches.py --token ${{ secrets.RICHIPROSIMA_DDS_SUITE_TOKEN }})" >> $GITHUB_OUTPUT
outputs:
branches: ${{ steps.list-branches.outputs.branches }}
update-dependencies:
needs: list-branches
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tracked_branch: ${{ fromJson(needs.list-branches.outputs.branches) }}
steps:
- uses: eProsima/eProsima-CI/external/checkout@v0
with:
ref: ${{ matrix.tracked_branch }}
- name: Get python helper script
if: ${{ matrix.tracked_branch != 'main' }}
run: |
mkdir -p .github/workflows
wget \
https://raw.githubusercontent.com/eProsima/DDS-Suite/main/.github/workflows/track_dependencies.py \
-O .github/workflows/track_dependencies.py
mkdir -p .git/info
echo ".github/workflows/track_dependencies.py" >> .git/info/exclude
- name: Update dependencies
id: update_dependencies
run: |
echo "updated=$(python3 .github/workflows/track_dependencies.py \
--token ${{ secrets.RICHIPROSIMA_DDS_SUITE_TOKEN }} \
--repos_file dds-suite.repos \
--branch ${{ matrix.tracked_branch }} \
--output_file dds-suite.repos)" >> $GITHUB_OUTPUT
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.RICHIPROSIMA_DDS_SUITE_TOKEN }}
committer: eProsima <ricardogonzalez@eprosima.com>
author: eProsima <ricardogonzalez@eprosima.com>
commit-message: Update ${{ matrix.tracked_branch }} dependencies
signoff: true
title: Update ${{ matrix.tracked_branch }} dependencies
body: |
Update ${{ matrix.tracked_branch }} dependencies:
* ${{ steps.update_dependencies.outputs.updated }}
branch: feature/update-${{ matrix.tracked_branch }}
base: ${{ matrix.tracked_branch }}
assignees: EduPonz