mirror of
https://github.com/Lissy93/personal-security-checklist.git
synced 2024-10-01 01:35:37 -04:00
51 lines
1.5 KiB
YAML
51 lines
1.5 KiB
YAML
name: ☑️ Generate and insert markdown from YAML
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches: [ master ]
|
|
paths: ['personal-security-checklist.yml']
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository 🛎️
|
|
uses: actions/checkout@v2
|
|
|
|
# Get current date-time (used for commit message)
|
|
- name: Get Date 📅
|
|
id: date
|
|
run: echo "::set-output name=date::$(date +'%d-%b-%Y')"
|
|
|
|
# Downloads + installs Python (used for running gen scripts)
|
|
- name: Set up Python 🐍
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.x'
|
|
|
|
# Install contents of requirements.txt
|
|
- name: Install dependencies 📥
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
cd lib && pip install -r requirements.txt
|
|
|
|
# The make command triggers all the Python scripts, generates output
|
|
- name: Run make command 🔨
|
|
run: python lib/generate.py
|
|
|
|
# Commit and push the outputed JSON files
|
|
- name: Commit and push generated files ⤴️
|
|
run: |
|
|
git config --global user.name "Liss-Bot"
|
|
git config --global user.email "alicia-gh-bot@mail.as93.net"
|
|
git pull origin master
|
|
git add CHECKLIST.md
|
|
if git diff --staged --quiet; then
|
|
echo "Nothin new added, so nothing to commit, exiting..."
|
|
else
|
|
git commit -m "Updates checklist (auto-generated, on ${{ steps.date.outputs.date }})"
|
|
git push
|
|
fi
|