Skip to content

Commit

Permalink
Review workflow (#2421)
Browse files Browse the repository at this point in the history
  • Loading branch information
pipo02mix authored Dec 14, 2024
1 parent 9263106 commit 4652b2b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/generate-review-issues.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Generate review Issues weekly
on:
schedule:
# At 0:00 on Sundays
- cron: '0 0 * * 0'
- cron: '0 0 * * 0'


jobs:
Expand All @@ -16,12 +16,13 @@ jobs:
run: pip3 install click colored PyYAML

- name: Validate front matter and last review date
run: |
echo "ISSUES=$(python3 scripts/validate-front-matter/script.py --validation last-reviewed --output json)" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
run: make validate-last-reviewed

- name: Generate issues of out of date docs
uses: giantswarm/open-issue@7774937e31b23a52257a34462a753b0a28a4d1f1 # 0.3.0
with:
with:
token: ${{ secrets.ISSUE_AUTOMATION }}
org: giantswarm
repo: giantswarm
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ validate-front-matter:
$(REGISTRY)/$(COMPANY)/docs-scriptrunner:latest \
/workdir/scripts/validate-front-matter/script.py

# Validate front matter for last-reviewed date.
validate-last-reviewed:
docker run --rm \
--volume=${PWD}:/workdir:ro \
-w /workdir \
$(REGISTRY)/$(COMPANY)/docs-scriptrunner:latest \
/workdir/scripts/validate-front-matter/script.py \
--validation last-reviewed \
--output json

# Print a report of pages with a last_review_date that's
# too long ago.
validate-last-reviewed:
Expand Down
3 changes: 2 additions & 1 deletion scripts/validate-front-matter/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
crds_path = 'src/content/reference/platform-api/crd'
vintage_crds_path = 'src/content/vintage/use-the-api/management-api/crd'
cluster_apps_path = 'src/content/reference/platform-api/cluster-apps'
meta_path = 'src/content/meta'
docs_host = 'https://github.com/giantswarm/docs/blob/main/'

todays_date = datetime.date.today()
Expand Down Expand Up @@ -161,7 +162,7 @@
{
'id': NO_LAST_REVIEW_DATE,
'description': 'The page should have a last_review_date',
'ignore_paths': [crds_path, vintage_crds_path, changes_path, cluster_apps_path],
'ignore_paths': [crds_path, vintage_path, changes_path, cluster_apps_path, meta_path],
'severity': SEVERITY_WARN,
},
{
Expand Down

0 comments on commit 4652b2b

Please sign in to comment.