Skip to content

Commit a38edb9

Browse files
committed
ci(deps): more version pinning and automated updates
1 parent 1ddea21 commit a38edb9

4 files changed

Lines changed: 95 additions & 2 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ updates:
77
commit-message:
88
prefix: "build"
99
include: "scope"
10+
open-pull-requests-limit: 10
1011

1112
- package-ecosystem: "pip"
1213
directory: "/.github/workflows"
@@ -15,6 +16,8 @@ updates:
1516
commit-message:
1617
prefix: "ci"
1718
include: "scope"
19+
allow:
20+
- dependency-type: "all"
1821

1922
- package-ecosystem: "github-actions"
2023
directory: "/"
@@ -23,3 +26,11 @@ updates:
2326
commit-message:
2427
prefix: "ci"
2528
include: "scope"
29+
30+
- package-ecosystem: "github-actions"
31+
directory: "/.github/workflows"
32+
schedule:
33+
interval: "monthly"
34+
commit-message:
35+
prefix: "ci"
36+
include: "scope"
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Check apt dependencies for updates
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0' # Run weekly on Sunday at midnight
6+
workflow_dispatch: # Allow manual triggering
7+
8+
jobs:
9+
check-apt-updates:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
15+
- name: Check for apt package updates
16+
run: |
17+
# Create a list of all pinned apt packages from github workflow files
18+
grep -r "apt-get install" .github/workflows/ | grep -o "[a-zA-Z0-9\-\._+~:]*=[a-zA-Z0-9\.\-+~:]*" > pinned_apt_packages.txt
19+
20+
# Create report file header
21+
echo "# Apt Package Update Report" > apt_update_report.md
22+
echo "Generated on $(date)" >> apt_update_report.md
23+
echo "" >> apt_update_report.md
24+
25+
if [ -s pinned_apt_packages.txt ]; then
26+
echo "Checking these pinned apt packages for updates:"
27+
cat pinned_apt_packages.txt
28+
29+
echo "## Pinned Packages" >> apt_update_report.md
30+
echo "" >> apt_update_report.md
31+
echo "| Package | Current Version | Latest Version | Update Available |" >> apt_update_report.md
32+
echo "|---------|----------------|---------------|-----------------|" >> apt_update_report.md
33+
34+
# Update apt database
35+
sudo apt-get update
36+
37+
updates_available=false
38+
39+
# Check each package for available updates
40+
while read package; do
41+
pkg_name=${package%=*}
42+
current_version=${package#*=}
43+
available_version=$(apt-cache policy $pkg_name | grep Candidate | awk '{print $2}')
44+
45+
echo "Package: $pkg_name"
46+
echo " Current pinned version: $current_version"
47+
echo " Latest available version: $available_version"
48+
echo ""
49+
50+
if [ "$current_version" != "$available_version" ]; then
51+
update_status="Yes"
52+
updates_available=true
53+
else
54+
update_status="No"
55+
fi
56+
57+
echo "| $pkg_name | $current_version | $available_version | $update_status |" >> apt_update_report.md
58+
done < pinned_apt_packages.txt
59+
60+
echo "" >> apt_update_report.md
61+
if [ "$updates_available" = true ]; then
62+
echo "## Action Required" >> apt_update_report.md
63+
echo "Please update the pinned versions in the workflow files to the latest available versions." >> apt_update_report.md
64+
else
65+
echo "## No Action Required" >> apt_update_report.md
66+
echo "All pinned packages are up to date." >> apt_update_report.md
67+
fi
68+
69+
echo "Check complete. Manual update required for any outdated packages."
70+
else
71+
echo "No pinned apt packages found in workflow files."
72+
echo "## No Pinned Packages Found" >> apt_update_report.md
73+
echo "No pinned apt packages were found in the workflow files." >> apt_update_report.md
74+
fi
75+
76+
- name: Create issue for outdated packages
77+
if: ${{ success() }}
78+
uses: peter-evans/create-issue-from-file@v5.0.1 # v5.0.1
79+
with:
80+
title: Outdated apt packages in workflows
81+
content-filepath: ./apt_update_report.md
82+
labels: dependencies, apt

.github/workflows/i18n-extract.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Install apt gettext package
4040
run: |
4141
sudo apt-get update
42-
sudo apt-get install -y gettext
42+
sudo apt-get install -y gettext=0.21-14ubuntu2
4343
4444
- name: Install python-gettext requirement
4545
run: |

.github/workflows/update_mo_files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Install apt packages
3636
run: |
3737
sudo apt-get update
38-
sudo apt-get install -y gettext
38+
sudo apt-get install -y gettext=0.21-14ubuntu2
3939
4040
- name: Compile translation .mo files from the .po files
4141
run: python create_mo_files.py

0 commit comments

Comments
 (0)