Skip to content

Commit 08117b6

Browse files
committed
Copy Files From Source Repo (2025-09-03 17:54)
1 parent 8a24de2 commit 08117b6

34 files changed

+1493
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Contributing to Microsoft Learning Repositories
2+
3+
MCT contributions are a key part of keeping the lab and demo content current as the Azure platform changes. We want to make it as easy as possible for you to contribute changes to the lab files. Here are a few guidelines to keep in mind as you contribute changes.
4+
5+
## GitHub Use & Purpose
6+
7+
Microsoft Learning is using GitHub to publish the lab steps and lab scripts for courses that cover cloud services like Azure. Using GitHub allows the course’s authors and MCTs to keep the lab content current with Azure platform changes. Using GitHub allows the MCTs to provide feedback and suggestions for lab changes, and then the course authors can update lab steps and scripts quickly and relatively easily.
8+
9+
> When you prepare to teach these courses, you should ensure that you are using the latest lab steps and scripts by downloading the appropriate files from GitHub. GitHub should not be used to discuss technical content in the course, or how to prep. It should only be used to address changes in the labs.
10+
11+
It is strongly recommended that MCTs and Partners access these materials and in turn, provide them separately to students. Pointing students directly to GitHub to access Lab steps as part of an ongoing class will require them to access yet another UI as part of the course, contributing to a confusing experience for the student. An explanation to the student regarding why they are receiving separate Lab instructions can highlight the nature of an always-changing cloud-based interface and platform. Microsoft Learning support for accessing files on GitHub and support for navigation of the GitHub site is limited to MCTs teaching this course only.
12+
13+
> As an alternative to pointing students directly to the GitHub repository, you can point students to the GitHub Pages website to view the lab instructions. The URL for the GitHub Pages website can be found at the top of the repository.
14+
15+
To address general comments about the course and demos, or how to prepare for a course delivery, please use the existing MCT forums.
16+
17+
## Additional Resources
18+
19+
A user guide has been provided for MCTs who are new to GitHub. It provides steps for connecting to GitHub, downloading and printing course materials, updating the scripts that students use in labs, and explaining how you can help ensure that this course’s content remains current.
20+
21+
<https://microsoftlearning.github.io/MCT-User-Guide/>

.github/ISSUE_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Module: 00
2+
## Lab/Demo: 00
3+
### Task: 00
4+
#### Step: 00
5+
6+
Description of issue
7+
8+
Repro steps:
9+
10+
1.
11+
1.
12+
1.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Module: 00
2+
## Lab/Demo: 00
3+
4+
Fixes # .
5+
6+
Changes proposed in this pull request:
7+
8+
-
9+
-
10+
-
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Zip Azure Storage Dotnet Files
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- 'main'
7+
paths:
8+
- 'allfiles/labs/dotnet/azure-storage/**'
9+
10+
defaults:
11+
run:
12+
shell: pwsh
13+
14+
jobs:
15+
create_zip:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Create Azure Storage zip
21+
run: |
22+
cd ./allfiles/labs/dotnet/azure-storage
23+
zip -r -q ../../../downloads/dotnet/azure-storage-dotnet.zip *
24+
- name: Commit and push
25+
uses: Endbug/add-and-commit@v7
26+
with:
27+
add: 'allfiles/downloads/dotnet/azure-storage-dotnet.zip'
28+
message: 'Updating Zip for dotnet source files'
29+
push: true
30+
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Sync remote markdown
2+
3+
on:
4+
schedule:
5+
# Daily at 06:00 UTC
6+
- cron: '0 6 * * *'
7+
# Allow manual runs
8+
workflow_dispatch: {}
9+
10+
permissions:
11+
contents: write
12+
13+
concurrency:
14+
group: sync-remote-markdown
15+
cancel-in-progress: false
16+
17+
jobs:
18+
sync:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
ref: main
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Download remote markdown files from list and strip front matter
28+
shell: bash
29+
run: |
30+
set -euo pipefail
31+
32+
mkdir -p _includes
33+
34+
CONFIG_TXT="_includes/sources.txt"
35+
36+
urls=()
37+
38+
# Load from plain text file: one URL per non-empty, non-comment line
39+
if [[ -f "$CONFIG_TXT" ]]; then
40+
while IFS= read -r line; do
41+
# trim leading/trailing whitespace (portable)
42+
line="$(sed -E 's/^[[:space:]]+//; s/[[:space:]]+$//' <<< "$line")"
43+
[[ -z "$line" || "$line" =~ ^# ]] && continue
44+
urls+=("$line")
45+
done < "$CONFIG_TXT"
46+
fi
47+
48+
if [[ ${#urls[@]} -eq 0 ]]; then
49+
echo "No sources found. Add URLs to _includes/sources.txt or a YAML list in _includes/sources.yml."
50+
exit 1
51+
fi
52+
53+
echo "Found ${#urls[@]} source(s)."
54+
55+
download_and_process() {
56+
local url="$1"
57+
58+
# Convert GitHub UI blob URLs to raw URLs if needed
59+
if [[ "$url" =~ ^https://github.com/([^/]+)/([^/]+)/blob/([^/]+)/(.*)$ ]]; then
60+
url="https://raw.githubusercontent.com/${BASH_REMATCH[1]}/${BASH_REMATCH[2]}/${BASH_REMATCH[3]}/${BASH_REMATCH[4]}"
61+
base_name="$(basename "${BASH_REMATCH[4]}")"
62+
else
63+
base_name="$(basename "$url")"
64+
fi
65+
66+
# Ensure it ends with .md for saving
67+
if [[ ! "$base_name" =~ \.md$ ]]; then
68+
base_name="${base_name}.md"
69+
fi
70+
71+
tmp_file=$(mktemp)
72+
out_file="_includes/${base_name}"
73+
74+
echo "Downloading: $url -> $out_file"
75+
curl -fsSL "$url" -o "$tmp_file"
76+
77+
# Strip a single YAML front-matter block only if it is at the very top of the file
78+
awk '
79+
NR==1 && $0 ~ /^---[[:space:]]*$/ { infront=1; next }
80+
infront && $0 ~ /^---[[:space:]]*$/ { infront=0; next }
81+
infront { next }
82+
{ print }
83+
' "$tmp_file" > "$out_file"
84+
85+
rm -f "$tmp_file"
86+
}
87+
88+
for u in "${urls[@]}"; do
89+
download_and_process "$u"
90+
done
91+
92+
- name: Commit and push if changes detected
93+
run: |
94+
git add _includes
95+
if git diff --staged --quiet; then
96+
echo "No changes to commit."
97+
exit 0
98+
fi
99+
git config user.name "github-actions[bot]"
100+
git config user.email "github-actions[bot]@users.noreply.github.com"
101+
git commit -m "chore: sync remote Markdown from sources list into _includes"
102+
git push origin main

0 commit comments

Comments
 (0)