-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (57 loc) · 2.25 KB
/
update_dependencies.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Manual and scheduled workflow to update dependencies
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
list-branches:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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: actions/checkout@v3
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@v4
with:
token: ${{ secrets.RICHIPROSIMA_DDS_SUITE_TOKEN }}
committer: eProsima <[email protected]>
author: eProsima <[email protected]>
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