Skip to content

Commit 6a8221c

Browse files
Merge pull request #191 from DSACMS/nat/checklist-pdf-workflow
Docs: Created GH Action workflow to generated pdfs of checklist from markdown files
2 parents 04cbbc2 + fce0b7d commit 6a8221c

9 files changed

+67
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Converting outbound checklists from .md to .pdf
2+
on:
3+
pull_request:
4+
types: [opened, synchronize]
5+
# Paths can be used to only trigger actions when you have edited checklist files
6+
paths:
7+
- 'tier*/checklist.md'
8+
9+
jobs:
10+
get-changed-directories:
11+
name: Get changed directories
12+
runs-on: ubuntu-latest
13+
outputs:
14+
tiers: ${{ steps.list-dirs.outputs.tiers }}
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 2
20+
- name: Get changed directories
21+
id: get-dirs
22+
uses: tj-actions/changed-files@v45
23+
with:
24+
dir_names: "true"
25+
- name: List all changed tier directories
26+
id: list-dirs
27+
env:
28+
ALL_CHANGED_FILES: ${{ steps.get-dirs.outputs.all_changed_files }}
29+
run: |
30+
# Obtain changed tier directories and format into array
31+
DIRS=$(echo "$ALL_CHANGED_FILES" | grep -oE 'tier[^ ]*' | sed 's/^/"/; s/$/"/' | paste -sd, -)
32+
33+
# Output the array
34+
TIER_DIRS="[$DIRS]"
35+
echo "$TIER_DIRS"
36+
37+
echo "tiers=$TIER_DIRS" >> "$GITHUB_OUTPUT"
38+
39+
convert-to-pdf:
40+
name: Build PDF
41+
runs-on: ubuntu-latest
42+
needs: get-changed-directories
43+
permissions:
44+
contents: write
45+
strategy:
46+
max-parallel: 1
47+
matrix:
48+
tier: ${{ fromJSON(needs.get-changed-directories.outputs.tiers) }} # List of changed tier directories
49+
steps:
50+
- uses: actions/checkout@v4
51+
with:
52+
ref: ${{ github.head_ref }}
53+
- name: Generate PDF for ${{ matrix.tier }}
54+
uses: baileyjm02/markdown-to-pdf@v1
55+
with:
56+
input_path: ${{ matrix.tier }}/checklist.md
57+
images_dir: assets
58+
image_import: ../assets
59+
output_dir: ${{ matrix.tier }}/
60+
build_html: false
61+
- name: Commit and push ${{ matrix.tier }} PDF
62+
uses: stefanzweifel/git-auto-commit-action@v5
63+
with:
64+
commit_message: "Updated ${{ matrix.tier }} checklist pdf"
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

tier1/checklist.md

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ This is a review process to approve CMS-developed software to be released open s
3434
[Flipping the Switch: Making the Repository Public](#flipping-the-switch-making-the-repository-public)
3535

3636

37-
3837
### State the Benefits of Open Sourcing the Project
3938

4039
- [ ] **Cost Savings**

tier1/checklist.pdf

91.9 KB
Binary file not shown.

tier2/checklist.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
### Instructions
55

6-
This is a review process to approve CMS-developed software to be released open source at [github.cms.gov](https://github.cms.gov/).
7-
If you would like your repository to be released, please complete the following steps.
6+
This is a review process to approve CMS-developed software to be released open source at [github.cms.gov](https://github.cms.gov/). If you would like your repository to be released, please complete the following steps.
87

98
[Instructions](#instructions)
109

@@ -35,7 +34,6 @@ If you would like your repository to be released, please complete the following
3534
[Flipping the Switch: Making the Repository Public](#flipping-the-switch-making-the-repository-public)
3635

3736

38-
3937
### State the Benefits of Open Sourcing the Project
4038

4139
- [ ] **Cost Savings**

tier2/checklist.pdf

141 KB
Binary file not shown.

tier3/checklist.md

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ If you would like your repository to be released, please complete the following
3535
[Flipping the Switch: Making the Repository Public](#flipping-the-switch-making-the-repository-public)
3636

3737

38-
3938
### State the Benefits of Open Sourcing the Project
4039

4140
- [ ] **Cost Savings**

tier3/checklist.pdf

147 KB
Binary file not shown.

tier4/checklist.md

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ If you would like your repository to be released, please complete the following
3636
[Flipping the Switch: Making the Repository Public](#flipping-the-switch-making-the-repository-public)
3737

3838

39-
4039
### State the Benefits of Open Sourcing the Project
4140

4241
- [ ] **Cost Savings**

tier4/checklist.pdf

152 KB
Binary file not shown.

0 commit comments

Comments
 (0)