updated tcet-linux-installer-config PKGBUILD #125
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |