Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/reusable-create-translation-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Create new translation version branch in language repository

on:
workflow_call:
inputs:
source_branch:
required: true
type: string
source_folder:
required: true
type: string
new_branch_name:
required: true
type: string

jobs:
pull_and_create_branch:
runs-on: ubuntu-latest

steps:
- name: Checkout current repo
uses: actions/checkout@v3
- name: Set up Git with GitHub Actions bot identity
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Pull content from another repository
run: |
git clone --branch ${{ inputs.source_branch }} --single-branch https://github.com/owaspsamm/core temp-repo
rm -rf temp-repo/.git
rsync -a --exclude='.git' temp-repo/ .
- name: Create a new branch with the pulled content
run: |
git checkout -b ${{ inputs.new_branch_name }}
git add ${{ inputs.source_folder }}
git commit -m "Pulled content from ${{ inputs.source_repo }}:${{ inputs.source_branch }}"
git push origin ${{ inputs.new_branch_name }}
44 changes: 44 additions & 0 deletions .github/workflows/reusable-yaml-process.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Reusable workflow to convert yaml files to markdown

on:
workflow_call:
inputs:
language:
required: true
type: string
branch:
required: true
type: string
model_folder:
required: true
type: string
jobs:
generate-markdown:
runs-on: ubuntu-latest
steps:
- name: 'Checkout using release is workflow dispatched'
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch }}
- name: 'Create output dir and copy files to override spaces in directories'
run: |
mkdir output
- name: 'Generate model for website'
uses: docker://backnot/owasp-samm-process-yaml-content:latest
with:
args: '-d ${{ inputs.model_folder }} -o output -l ${{ inputs.language }}'
- name: 'Move generated files to common directory structure'
run: |
mkdir -p build/business-function/practice/stream
BASE=output/markdown
cp "$BASE"/{Design.md,Governance.md,Implementation.md,Operations.md,Verification.md} build/business-function
cp "$BASE"/*-??-?.md build/business-function/practice/stream
cp "$BASE"/*-??.md build/business-function/practice
- name: Deploy
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: markdown
FOLDER: build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SQUASH_HISTORY: false