.github/workflows/insert-privacy-list.yml

50 lines · 1594 bytes

 1name: 📚 Inserts Awesome Privacy into README
 2
 3on:
 4  workflow_dispatch:
 5  push:
 6    branches: [ main ]
 7    paths: ['awesome-privacy.yml']
 8    
 9jobs:
10  build:
11    runs-on: ubuntu-latest
12
13    steps:
14      - name: Checkout repository 🛎️
15        uses: actions/checkout@v2
16        
17      # Get current date-time (used for commit message)
18      - name: Get Date 📅
19        id: date
20        run: echo "::set-output name=date::$(date +'%d-%b-%Y')"
21        
22      # Downloads + installs Python (used for running gen scripts)  
23      - name: Set up Python 🐍
24        uses: actions/setup-python@v2
25        with:
26          python-version: '3.x'
27          
28      # Install contents of requirements.txt
29      - name: Install dependencies 📥
30        run: |
31          python -m pip install --upgrade pip
32          cd lib && pip install -r requirements.txt
33
34      # The make command triggers all the Python scripts, generates output
35      - name: Run make command 🔨
36        run: python lib/awesome-privacy-readme-gen.py
37
38      # Commit and push the outputed readme
39      - name: Commit and push generated files ⤴️
40        run: |
41          git config --global user.name "Liss-Bot"
42          git config --global user.email "alicia-gh-bot@mail.as93.net"
43          git pull origin main
44          git add .github/README.md
45          if git diff --staged --quiet; then
46            echo "Nothin new added, so nothing to commit, exiting..."
47          else
48            git commit -m "Updated Awesome Privacy content (last modified on ${{ steps.date.outputs.date }})"
49            git push
50          fi