1
+---
2
+# Auto-generate issues for EOL of platforms that are approaching their EOL date.
3
+# Uses https://endoflife.date and their new API to check for EOL dates.
4
+#
5
+# Issues are created when the EOL date is within the next 30 days.
6
+name: Check Platform EOL
7
+on: # Run weekly and whenever manually triggered
8
+ schedule:
9
+ - cron: '0 3 * * 1'
10
+ workflow_dispatch: null
11
+concurrency: # Simple single-instance concurrency.
12
+ group: eol-check-${{ github.repository }}
13
+ cancel-in-progress: true
14
+jobs:
15
+ # Prepare the build matrix.
16
+ # This uses output from .github/scripts/gen-matrix-eol-check.py
17
+ matrix:
18
+ name: Prepare Build Matrix
19
+ runs-on: ubuntu-latest
20
+ outputs:
21
+ matrix: ${{ steps.set-matrix.outputs.matrix }}
22
+ steps:
23
+ - name: Checkout
24
+ id: checkout
25
+ uses: actions/checkout@v3
26
+ - name: Prepare tools
27
+ id: prepare
28
+ run: |
29
+ sudo apt-get update && sudo apt-get install -y python3-ruamel.yaml
30
+ - name: Read build matrix
31
+ id: set-matrix
32
+ run: |
33
+ matrix="$(.github/scripts/gen-matrix-eol-check.py)"
34
+ echo "Generated matrix: ${matrix}"
35
+ echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
36
+
37
+ eol-check:
38
+ name: EOL Check
39
+ runs-on: ubuntu-latest
40
+ needs:
41
+ - matrix
42
+ strategy:
43
+ matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
44
+ fail-fast: false # We want to check everything, so don’t bail on the first failure.
45
+ max-parallel: 2 # Cap of two jobs at a time to limit impact on other CI.
46
+ steps:
47
+ - name: Checkout
48
+ id: checkout
49
+ uses: actions/checkout@v3
50
+ # Actually check the EOL date for the platform.
51
+ - name: Check EOL Date
52
+ id: check
53
+ run: |
54
+ d="$(.github/scripts/platform-impending-eol.py ${{ matrix.distro }} ${{ matrix.release }})"
55
+ case $? in
56
+ 0) echo "pending=false" >> "${GITHUB_OUTPUT}" ;;
57
+ 2)
58
+ echo "pending=true" >> "${GITHUB_OUTPUT}"
59
+ echo "date=${d}" >> "${GITHUB_OUTPUT}"
60
+ ;;
61
+ *)
62
+ echo "::error::Failed to check EOL date for ${{ matrix.distro }} ${{ matrix.release }}"
63
+ exit 1
64
+ ;;
65
+ esac
66
+ # Figure out the issue title.
67
+ # This is it’s own step so we only have to set it in one place.
68
+ - name: Determine Issue Title
69
+ id: title
70
+ if: steps.check.outputs.pending == 'true'
71
+ run: |
72
+ echo "title=[Platform EOL]: ${{ matrix.full_name }} will be EOL soon." >> "${GITHUB_OUTPUT}"
73
+ # Check if there is an existing issue in the repo for the platform EOL.
74
+ # The actual command line to make the check is unfortunately complicated because
75
+ # GitHub think that it’s sensible to exit with a status of 0 if there no results
76
+ # for a search.
77
+ - name: Check for Existing Issue
78
+ id: existing
79
+ if: steps.check.outputs.pending == 'true'
80
+ env:
81
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82
+ run: |
83
+ set -e
84
+ count=$(gh issue list -R netdata/netdata -s all -S '${{ steps.title.outputs.title }} in:title' --json 'id' -q '. | length')
85
+ if [ "${count}" -ge 1 ]; then
86
+ echo 'exists=true' >> "${GITHUB_OUTPUT}"
87
+ else
88
+ echo 'exists=false' >> "${GITHUB_OUTPUT}"
89
+ fi
90
+ # If the platform is near EOL and there is no existing issue, create one.
91
+ - name: Create EOL Issue
92
+ id: create-issue
93
+ if: steps.check.outputs.pending == 'true' && steps.existing.outputs.exists == 'false'
94
+ uses: imjohnbo/issue-bot@v3
95
+ with:
96
+ assignees: Ferroin, tkatsoulas
97
+ labels: area/packaging, needs triage
98
+ title: ${{ steps.title.outputs.title }}
99
+ body: |
100
+ Based on information from https://endoflife.date/${{ matrix.distro }},
101
+ upstream support for ${{ matrix.full_name }} will be ending
102
+ on ${{ steps.check.outputs.date }}. A PR should be created
103
+ to remove this platform from our platform support document,
104
+ CI, and packaging code.
105
+
106
+ - [ ]: Remove platform from `packaging/PLATFORM_SUPPORT.md`
107
+ - [ ]: Remove platform from `.github/data/distros.yml`
108
+ - [ ]: Remove platform package builder from helper-images repo (if applicable).
109
+ - [ ]: Verify any other platform support code that needs to be cleaned up.