47 lines (45 loc) · 1.97 KB
/
main.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
name: Periodically update the list of available usernames
on:
schedule:
- cron: 0 0 1 1 *
jobs:
ci-update:
runs-on: ubuntu-latest
container: fedora:latest
steps:
- name: Install the development dependency package
run: |
sudo dnf install gcc git krb5-devel krb5-workstation poetry python3-devel python3-pip --assumeyes
- name: Configure Git before starting off with any Git related operations
run: |
git config --global --add safe.directory $(realpath .)
git config --global user.email ${{ secrets.USERMAIL }}
git config --global user.name ${{ secrets.USERNAME }}
- name: Clone the project repository in its current state
run: |
git clone https://${{ secrets.GTHBUSER }}:${{ secrets.GHBTOKEN }}@github.com/t0xic0der/fuas.git /__w/fuas/fuas
- name: Add the required workarounds to allow for authentication
run: |
sed -ri "s/default_ccache_name/#default_ccache_name/g" /etc/krb5.conf
- name: Authenticate a new session in the mentioned realm
run: |
echo -n ${{ secrets.KERBPASS }} | kinit ${{ secrets.KERBUSER }}
- name: Install the project assets in the root directory
run: |
poetry config virtualenvs.create false
poetry install
- name: Fetch the list of usernames from FASJSON
run: |
fuas namelist
- name: Pull the most recently made changes before moving in the modified files
run: |
git pull origin main
- name: Copy over the file to the project directory
run: |
cp /var/tmp/namefile /__w/fuas/fuas/data/namefile
- name: Commit the changes to the local repository
run: |
git commit -asm "$(date +%Y%m%d-%H%M%Z): $(cat /__w/fuas/fuas/data/namefile | wc -l) username(s) available"
- name: Push the new changes to the remote repository
run: |
git push origin main