diff --git a/.github/workflows/release-pdf-action.yaml b/.github/workflows/release-pdf-action.yaml new file mode 100644 index 0000000..f925227 --- /dev/null +++ b/.github/workflows/release-pdf-action.yaml @@ -0,0 +1,38 @@ +name: Generate PDF Release + +on: + push: + tags: + - 'v*' + workflow_dispatch: # Allow manual triggering + +jobs: + generate-pdf-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Generate PDF + run: python security-plus-all.py + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.event.ref }} + release_name: Release ${{ github.event.ref }} + body: | + Automated release generated from markdown files. + draft: false + prerelease: false + files: | + security-plus-sy0-601-all.pdf diff --git a/3.0-implementation/3.8-given-a-scenario-implement-authentication-and-authorization-solutions.md b/3.0-implementation/3.8-given-a-scenario-implement-authentication-and-authorization-solutions.md index d3eaac0..3e4c37b 100644 --- a/3.0-implementation/3.8-given-a-scenario-implement-authentication-and-authorization-solutions.md +++ b/3.0-implementation/3.8-given-a-scenario-implement-authentication-and-authorization-solutions.md @@ -1,4 +1,4 @@ -# 3.8 +# 3.8 Given a scenario implement authentication and authorization solutions ## Authentication management diff --git a/security-plus-all.py b/security-plus-all.py index 10a0c95..7e9683d 100755 --- a/security-plus-all.py +++ b/security-plus-all.py @@ -14,9 +14,10 @@ def generate_security_plus_file(): with open(markdown_file, "w") as f: f.write("# **CompTIA Security+ (SY0-601)**\n\n") folders = [f for f in os.listdir() if os.path.isdir(f) and re.match(r"\d\.\d-[a-z-]+", f)] + folders = sorted(folders) for folder in folders: folder_path = os.path.join(os.getcwd(), folder) - files = [f for f in os.listdir(folder_path) if os.path.isfile(os.path.join(folder_path, f)) and re.match(r"\d+\.\d+-[a-z-]+\.md", f)] + files = [f for f in os.listdir(folder_path) if os.path.isfile(os.path.join(folder_path, f)) and re.match(r"\d+\.\d+-[a-zA-Z-]+\.md", f)] files = sorted(files) if files: folder_title = "-".join(folder.split("-")[1:]).replace("-", " ").title() @@ -24,6 +25,7 @@ def generate_security_plus_file(): for file in files: with open(os.path.join(folder_path, file), "r") as fp: f.write(fp.read() + "\n") + f.write("\n") if __name__ == "__main__": generate_security_plus_file()