initialize #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Markdown on Release | |
on: | |
release: | |
types: [published] | |
jobs: | |
generate-markdown: | |
if: contains(github.event.release.name, 'MARKDOWN') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '14' | |
- name: Install dependencies | |
run: npm install | |
- name: Configure Git identity | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Your Name" | |
- name: Fetch main branch | |
run: git fetch origin main:main | |
- name: Switch to main branch | |
run: git checkout main | |
- name: Generate markdown | |
run: | | |
node scripts/render-tp.js "JavaScript Tracking Plan" "plans/prod/javascript/current-rules.json" "docs/javascript_tracking_plan.md" | |
node scripts/render-tp.js "Server Tracking Plan" "plans/prod/server/current-rules.json" "docs/server_tracking_plan.md" | |
- name: Commit and push changes | |
run: | | |
git add docs/javascript_tracking_plan.md docs/server_tracking_plan.md | |
git commit -m "Test markdown generation" || echo "No changes to commit" | |
git push origin main |