-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (57 loc) · 1.88 KB
/
check-updates.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
name: Check for package updates
on: [push]
permissions:
contents: read
issues: write
jobs:
check-for-updates:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: Install latest git
run: |
pacman -Syy --noconfirm git
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Create non_root user
run: |
useradd nonroot && mkdir /home/nonroot && chown -R nonroot:nonroot /home/nonroot
- name: Set nonroot user in sudoers
run: |
echo 'nonroot ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
- name: Set root user in sudoers
run: |
echo 'root ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
- name: Enable multilib
run: |
echo -e '[multilib]\nInclude = /etc/pacman.d/mirrorlist\n' >> /etc/pacman.conf
- name: Enable extra
run: |
sed -i '/^#\[extra\]/{N;s/#//g}' /etc/pacman.conf
- name: Install dependencies
run: |
pacman -Syyu --noconfirm && pacman -S --noconfirm just base-devel sudo xorgproto
- name: Set source permissions
run: |
chown -R nonroot:nonroot .
- name: Build packages
run: |
sudo -u nonroot just check-updates
- name: Create diff
id: repo-diff
run: |
filename="/tmp/diff-$(date +"%d.%m.%Y_%H%M%S").patch"
sudo -u nonroot git diff > $filename
repodiff=$(cat $filename)
echo 'REPO_DIFF=$repodiff' >> $GITHUB_OUTPUT
- uses: JasonEtco/create-an-issue@v2
if: ${{ steps.repo-diff.outputs.REPO_DIFF != '' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_DIFF: ${{ steps.repo-diff.outputs.REPO_DIFF }}
with:
update_existing: true
search_existing: all
filename: .github/git-update-issue-template.md