-
Notifications
You must be signed in to change notification settings - Fork 7
52 lines (49 loc) · 1.53 KB
/
automation.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
name: Automated pgpkeys format fix & update map.txt
on:
push:
paths:
- "keys/*"
schedule:
- cron: "0 0 * * *"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
fix:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Fix key formatting
run: ./fix.sh
- name: Commit and push changes
run: |
git config --local user.name "pgpkeys[bot]"
git config --local user.email "pgpkeys[bot]@users.noreply.github.com"
git add keys/*
git diff-index --quiet HEAD || git commit -m "chore: fix key formatting"
git push
update-map:
runs-on: ubuntu-latest
needs: fix
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Update map.txt
run: python genmap.py
- name: Commit and push changes
run: |
git config --local user.name "pgpkeys[bot]"
git config --local user.email "pgpkeys[bot]@users.noreply.github.com"
git pull
git add map.txt
git commit -m "chore: update mapping"
if [ -n "$(git diff HEAD^ map.txt | grep -E '^[+-]\s*(U:|W:|P:)')" ]; then git push; fi