Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
Signed-off-by: Natalia Luzuriaga <[email protected]>
  • Loading branch information
natalialuzuriaga committed Oct 29, 2024
1 parent 75037d5 commit 642f22b
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/markdownToPDF.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Converting outbound checklists from .md to .pdf
on:
pull_request:
types: [opened, synchronize]
# Paths can be used to only trigger actions when you have edited checklist files or assets directory
paths:
- 'tier*/checklist.md'
- 'assets/**'

jobs:
get-changed-directories:
name: Get changed directories
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Get changed directories
id: get-dirs
uses: tj-actions/changed-files@v45
with:
dir_names: "true"

- name: List all changed directories
env:
ALL_CHANGED_FILES: ${{ steps.get-dirs.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
outputs:
tiers: ${{ steps.get-dirs.outputs.all_changed_files }}

convert-to-pdf:
name: Build PDF
runs-on: ubuntu-latest
needs: get-changed-directories
permissions:
contents: write # Set permissions to allow writes to the repository
strategy:
matrix:
tier: ${{ needs.get-changed-directories.outputs.tiers }} # List of directories
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Generate PDF for ${{ matrix.tier }}
uses: baileyjm02/markdown-to-pdf@v1
with:
input_path: ${{ matrix.tier }}/checklist.md
images_dir: assets
image_import: ../assets
output_dir: ${{ matrix.tier }}/
# Default is true, can set to false to only get PDF files
build_html: false
- name: Commit and push ${{ matrix.tier }} PDF
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Updated ${{ matrix.tier }} checklist pdf"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required for authentication
1 change: 0 additions & 1 deletion tier1/checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ This is a review process to approve CMS-developed software to be released open s
[Flipping the Switch: Making the Repository Public](#flipping-the-switch-making-the-repository-public)



### State the Benefits of Open Sourcing the Project

- [ ] **Cost Savings**
Expand Down
1 change: 0 additions & 1 deletion tier2/checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ If you would like your repository to be released, please complete the following
[Flipping the Switch: Making the Repository Public](#flipping-the-switch-making-the-repository-public)



### State the Benefits of Open Sourcing the Project

- [ ] **Cost Savings**
Expand Down

0 comments on commit 642f22b

Please sign in to comment.