Skip to content

Merge branch 'main' of https://github.com/MicrosoftLearning/mslearn-g… #11

Merge branch 'main' of https://github.com/MicrosoftLearning/mslearn-g…

Merge branch 'main' of https://github.com/MicrosoftLearning/mslearn-g… #11

name: CreateGHSpecKitEx14Zip
on:
workflow_dispatch:
push:
branches:
- '**'
paths:
- DownloadableCodeProjects/standalone-lab-projects/sdd-get-started-rss-feed/**/*.md
pull_request:
branches:
- '**'
paths:
- DownloadableCodeProjects/standalone-lab-projects/sdd-get-started-rss-feed/**/*.md
defaults:
run:
shell: bash
jobs:
create_zip:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create GHSpecKitEx14 Stakeholder Documents zip
run: |
# Ensure Downloads directory exists
mkdir -p DownloadableCodeProjects/Downloads
# Remove existing zip file
rm -f DownloadableCodeProjects/Downloads/GHSpecKitEx14StakeholderDocuments.zip
# Zip only the contents of the sdd-get-started-rss-feed folder (not the parent path)
cd DownloadableCodeProjects/standalone-lab-projects/sdd-get-started-rss-feed
CONTENTS=$(ls -A)
if [ -z "$CONTENTS" ]; then
echo "No files to zip in sdd-get-started-rss-feed"
exit 1
fi
zip -r -q ../../Downloads/GHSpecKitEx14StakeholderDocuments.zip $CONTENTS
cd -
# Verify zip file was created
if [ ! -f DownloadableCodeProjects/Downloads/GHSpecKitEx14StakeholderDocuments.zip ]; then
echo "Failed to create zip file"
exit 1
fi
echo "Successfully created GHSpecKitEx14StakeholderDocuments.zip"
- name: Commit and push
uses: Endbug/add-and-commit@v7
with:
add: '["DownloadableCodeProjects/Downloads/GHSpecKitEx14StakeholderDocuments.zip"]'
message: 'Updating Zip with sample app source files'
push: true