-
-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·71 lines (64 loc) · 2.17 KB
/
shasum.yml
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
67
68
69
70
71
name: Update
on:
push:
branches: main
workflow_dispatch:
repository_dispatch:
types: [trigger-workflow]
jobs:
updating:
runs-on: ubuntu-latest
container:
image: archlinux:latest
options: --privileged
permissions:
contents: write
pull-requests: write
steps:
- name: Installing dependencies
run: pacman -Syu base-devel git github-cli pacman-contrib sudo fakeroot --noconfirm --needed
- name: Cloning repo
run: git clone https://github.com/tcet-opensource/tcet-linux-pkgbuild.git
- name: Downloading Script
run: curl https://raw.githubusercontent.com/tcet-opensource/tcet-linux-automation-scripts/main/updsum.sh -o updsum.sh
- name: Making executable
run: |
ls -al
chmod -R 777 .
chmod +777 updsum.sh
ls -al
- name: Creating new User
run: |
useradd non_root && mkdir /home/non_root && chown -R non_root:non_root /home/non_root
echo 'non_root ALL=NOPASSWD: ALL' >>/etc/sudoers
ls -al
- name: Updating Shasum
run: sudo -u non_root ./updsum.sh
- name: Removing Script
run: rm -rf updsum.sh
- name: Setup git
run: |
git config --global user.name "Github Action[bot]"
git config --global user.email "[email protected]"
- name: Check changes
id: git_diff
run: |
cd tcet-linux-pkgbuild/
git diff-index --quiet HEAD -- || echo "has_changes=true" >> $GITHUB_ENV
- name: Check changed files
id: git_status
if: env.has_changes == 'true'
run: |
cd tcet-linux-pkgbuild/
echo "changed_files<<EOF" >>$GITHUB_ENV
git status --porcelain >>$GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
shell: bash
- name: Pushing to main
if: env.changed_files != ''
run: |
cd tcet-linux-pkgbuild/
git add .
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/tcet-opensource/tcet-linux-pkgbuild.git
git commit -m "Updating Shasum"
git push -u origin main --force