added description #133
Workflow file for this run
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: Validate draft authors | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: "${{ github.event.pull_request.head.sha }}" | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
drafts: | |
- '_drafts/**' | |
- name: Get all changed files | |
if: steps.filter.outputs.drafts == 'true' | |
id: files | |
uses: Ana06/[email protected] | |
- uses: actions/setup-python@v2 | |
if: steps.filter.outputs.drafts == 'true' | |
with: | |
python-version: '3.x' | |
- name: Install python dependencies | |
if: steps.filter.outputs.drafts == 'true' | |
run: | | |
pip install python-frontmatter PyYAML requests | |
- name: Get validation script from main branch | |
if: steps.filter.outputs.drafts == 'true' | |
run: | | |
rm -rf _scripts | |
wget https://raw.githubusercontent.com/genicsblog/theme-files/main/_scripts/validate-drafts.py -P _scripts | |
- name: Validate draft author | |
if: steps.filter.outputs.drafts == 'true' | |
run: | | |
echo "${{ steps.files.outputs.all }}" >> temp.txt | |
python _scripts/validate-drafts.py ${{ github.event.pull_request.user.login }} | |
rm temp.txt |