-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (46 loc) · 1.61 KB
/
release.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
# TODO: Release a docker image for each service that has a changed VERSION file
name: test-detecting-version-changes
run-name: Detecting changes in VERSION files
on:
push:
branches:
- main
paths:
- '*/VERSION'
jobs:
print-changed-services:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Store services with changed VERSION files
id: changed-services
run: |
echo "services=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep '/VERSION$' | grep -v 'TEMPLATE' | cut -d '/' -f 1 | uniq | jq -R -s -c 'split("\n")[:-1]')" >> "$GITHUB_OUTPUT"
- name: Print services with changed VERSION files
run: |
echo "Services with changed VERSION files: ${{ steps.changed-services.outputs.services }}"
outputs:
services: ${{ steps.changed-services.outputs.services }}
for-each-changed:
needs: print-changed-services
runs-on: ubuntu-latest
if: needs.print-changed-services.outputs.services != '[]'
strategy:
matrix:
service: ${{ fromJson(needs.print-changed-services.outputs.services) }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Enter service directory
run: cd ${{ matrix.service }}
- name: Print changed files
run: |
echo "Changed files: $(git diff --name-only ${{ github.event.before }} ${{ github.event.after }})"
- name: Print service
run: |
echo "Service: ${{ matrix.service }}"