Skip to content

Commit bcb32fa

Browse files
committed
Initial commit
0 parents  commit bcb32fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+9203
-0
lines changed

.github/example.md

Lines changed: 912 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build Jekyll site
2+
on:
3+
push:
4+
branches: ["main"] # Trigger the workflow on push to the main branch
5+
permissions:
6+
contents: read # Read access to repository contents
7+
pages: write # Write access to GitHub Pages
8+
id-token: write # Write access to the ID token
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest # Use the latest Ubuntu runner
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4 # Checkout the repository code
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v4 # Set up Node.js environment
18+
with:
19+
node-version: '16' # Specify Node.js version 16
20+
21+
- name: Setup Pages
22+
uses: actions/configure-pages@v5 # Configure GitHub Pages
23+
24+
- name: Install reveal-md
25+
run: npm install -g reveal-md # Install reveal-md globally
26+
27+
- name: Generate slides with reveal-md into the docs folder
28+
run: reveal-md slides.md --static docs --theme theme/simatic-ax.css -css theme/simatic-ax.css --assets-dir dist --staticDirs img
29+
# Generate static slides with reveal-md and place them in the docs folder
30+
31+
- name: Upload docs folder as artifact
32+
uses: actions/upload-pages-artifact@v2 # Upload the docs folder as an artifact
33+
with:
34+
path: docs/ # Specify the path to the docs folder
35+
36+
deploy:
37+
runs-on: ubuntu-latest # Use the latest Ubuntu runner
38+
needs: build # Run this job after the build job
39+
steps:
40+
- name: Deploy to GitHub Pages
41+
id: deployment
42+
uses: actions/deploy-pages@v2 # Deploy the site to GitHub Pages
43+
environment:
44+
name: github-pages # Specify the environment name
45+
url: ${{ steps.deployment.outputs.page_url }} # Set the URL of the deployed site
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
2+
# This GitHub Actions workflow generates an assessment Excel file for SIMATIC AX projects
3+
# and automatically creates an issue with download links and notification emails.
4+
#
5+
# Workflow Structure:
6+
# 1. collect-info: Gathers project information and creates info.yml artifact
7+
# 2. fill-excel: Downloads info, generates Excel file, and uploads as artifact
8+
# 3. notify: Creates GitHub issue with download links and email notification
9+
#
10+
# The workflow is triggered manually via workflow_dispatch with two required inputs:
11+
# - EXACT_Ticket_ID: The EX Classification Ticket number
12+
# - Approver: The business approver (Promotor BL) selected from predefined options
13+
#
14+
# Artifacts generated:
15+
# - info-yml: Contains collected project information
16+
# - assessment-excel: The generated questionnaire Excel file
17+
#
18+
# The final issue includes direct links to the workflow run for artifact download
19+
# and a mailto link for email notification to the actor.
20+
21+
name: Start Assessment
22+
on:
23+
workflow_dispatch:
24+
inputs:
25+
EXACT_Ticket_ID:
26+
description: 'Your EX Classification Ticket'
27+
required: true
28+
default: '0000'
29+
Approver:
30+
description: 'Promotor BL (Approver from Business Side to release)'
31+
required: true
32+
type: string
33+
34+
jobs:
35+
# Job 1: Collect project information and create info.yml artifact
36+
# Uses simatic-ax internal action to gather project details, ticket info, and approver data
37+
collect-info:
38+
runs-on: ubuntu-latest
39+
steps:
40+
# Checkout the repository to access project files
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
44+
# Set up Python environment for the collection script
45+
- name: Set up Python
46+
uses: actions/setup-python@v4
47+
with:
48+
python-version: '3.x'
49+
50+
# Install required Python dependencies for info collection
51+
- name: Install Python dependencies
52+
run: |
53+
python3 -m pip install requests pyyaml openpyxl
54+
55+
# Collect project information using internal Simatic AX action
56+
# This creates an info.yml file with project details, ticket ID, and approver
57+
- name: Collect Info
58+
uses: simatic-ax/internal-actions/collect-assessment-information@v1
59+
with:
60+
project_name: ${{ github.repository }}
61+
username: ${{ github.actor }}
62+
token: ${{ secrets.READ_USER_TOKEN }}
63+
ticket_id: ${{ inputs.EXACT_Ticket_ID }}
64+
approver: ${{ inputs.Approver }}
65+
66+
# Upload the generated info.yml as an artifact for use in subsequent jobs
67+
- name: Upload info.yml
68+
uses: actions/upload-artifact@v3
69+
with:
70+
name: info-yml
71+
path: info.yml
72+
73+
# Job 2: Generate the assessment Excel file using the collected information
74+
# Downloads info.yml artifact and creates the questionnaire Excel file
75+
fill-excel:
76+
runs-on: ubuntu-latest
77+
needs: collect-info # Wait for info collection to complete
78+
steps:
79+
# Checkout repository for Excel generation scripts
80+
- name: Checkout repository
81+
uses: actions/checkout@v4
82+
83+
# Set up Python environment for Excel generation
84+
- name: Set up Python
85+
uses: actions/setup-python@v4
86+
with:
87+
python-version: '3.x'
88+
89+
# Install Python dependencies required for Excel file creation
90+
- name: Install Python dependencies
91+
run: |
92+
python3 -m pip install requests pyyaml openpyxl
93+
94+
# Download the info.yml artifact created in the previous job
95+
- name: Download info.yml
96+
uses: actions/download-artifact@v3
97+
with:
98+
name: info-yml
99+
100+
# Generate the assessment Excel file using internal Simatic AX action
101+
# This creates a Questionnaire_Contribution_*.xlsx file
102+
- name: Create Assessment Excel-File
103+
uses: simatic-ax/internal-actions/create-assessment-excel@v1
104+
105+
# Upload the generated Excel file as an artifact for download
106+
- name: Upload Excel artifact
107+
uses: actions/upload-artifact@v3
108+
with:
109+
name: assessment-excel
110+
path: Questionnaire_Contribution_*.xlsx
111+
112+
# Print workflow run information for reference
113+
# Note: Artifacts are only available via API after complete workflow finish
114+
- name: Print Run ID after Excel artifact upload
115+
run: |
116+
echo "Aktuelle Run ID: ${{ github.run_id }}"
117+
echo "Excel artifact wird nach Workflow-Ende verfügbar sein unter:"
118+
echo "https://github.siemens.cloud/${{ github.repository }}/actions/runs/${{ github.run_id }}"
119+
120+
# Job 4: Trigger notification workflow with direct artifact links
121+
# This job calls the separate notify-assessment workflow to create detailed issues with artifact download links
122+
trigger-notify:
123+
runs-on: ubuntu-latest
124+
needs: fill-excel # Wait for notify to complete
125+
steps:
126+
# Download info.yml to extract ticket information for notification
127+
- name: Download info.yml
128+
uses: actions/download-artifact@v3
129+
with:
130+
name: info-yml
131+
132+
# Extract ticket ID and email for notification content
133+
- name: Extract notification info
134+
id: extract-info
135+
run: |
136+
SCD_MAIL=$(cat info.yml | grep scd_mail | awk '{print $2}')
137+
TICKET_ID=$(cat info.yml | grep ticket_id | awk '{print $2}')
138+
echo "scd_mail=$SCD_MAIL" >> $GITHUB_OUTPUT
139+
echo "ticket_id=$TICKET_ID" >> $GITHUB_OUTPUT
140+
141+
# Trigger the separate notification workflow with direct artifact links
142+
- name: Trigger notification workflow
143+
run: |
144+
ISSUE_TITLE="Assessment Excel Ready - Direct Downloads (Ticket: ${{ steps.extract-info.outputs.ticket_id }})"
145+
ISSUE_BODY="🎯 **Assessment Excel Generation Complete**\n\nTicket ID: **${{ steps.extract-info.outputs.ticket_id }}**\nTriggered by: **${{ github.actor }}**\n\n📧 **Quick Email Notification:**\n[Send email to ${{ steps.extract-info.outputs.scd_mail }}](mailto:${{ steps.extract-info.outputs.scd_mail }}?subject=Assessment%20Excel%20Ready%20-%20Ticket%20${{ steps.extract-info.outputs.ticket_id }}&body=Hello,%0A%0AYour%20assessment%20Excel%20file%20has%20been%20generated%20successfully.%0A%0ATicket:%20${{ steps.extract-info.outputs.ticket_id }}%0AWorkflow%20Run:%20https://github.siemens.cloud/${{ github.repository }}/actions/runs/${{ github.run_id }}%0A%0APlease%20check%20the%20GitHub%20issue%20for%20direct%20download%20links.%0A%0ABest%20regards)"
146+
147+
curl -X POST \
148+
-H "Authorization: token ${{ secrets.GH_ISSUE_CREATOR_TOKEN }}" \
149+
-H "Accept: application/vnd.github.v3+json" \
150+
"https://github.siemens.cloud/api/v3/repos/${{ github.repository }}/actions/workflows/notify-assessment.yml/dispatches" \
151+
-d "{
152+
\"ref\": \"main\",
153+
\"inputs\": {
154+
\"run_id\": \"${{ github.run_id }}\",
155+
\"repository\": \"${{ github.repository }}\",
156+
\"actor\": \"${{ github.actor }}\"
157+
}
158+
}"
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Notification workflow for assessment Excel file completion
2+
# This workflow is triggered by the generate_assessment workflow to create
3+
# GitHub issues with direct artifact download links after workflow completion.
4+
#
5+
# The workflow fetches artifacts from the specified run ID and creates
6+
# direct download links for each artifact in the GitHub issue.
7+
8+
name: 'Create Assessment Notification Issue'
9+
description: 'Creates a GitHub issue with artifact download links for completed assessment workflows'
10+
11+
on:
12+
workflow_dispatch:
13+
inputs:
14+
run_id:
15+
description: 'Run ID of the completed assessment workflow'
16+
required: true
17+
type: string
18+
repository:
19+
description: 'Repository name in format owner/repo'
20+
required: true
21+
type: string
22+
actor:
23+
description: 'GitHub username of the person who triggered the original workflow'
24+
required: false
25+
type: string
26+
27+
jobs:
28+
create-notification-issue:
29+
runs-on: ubuntu-latest
30+
steps:
31+
# Download info.yml artifact from the specified workflow run
32+
- name: Download info.yml artifact
33+
run: |
34+
# Get artifacts from the specified run
35+
ARTIFACTS_JSON=$(curl -s -H "Authorization: token ${{ secrets.GH_ISSUE_CREATOR_TOKEN }}" \
36+
"https://github.siemens.cloud/api/v3/repos/${{ inputs.repository }}/actions/runs/${{ inputs.run_id }}/artifacts")
37+
38+
# Find info-yml artifact
39+
INFO_ARTIFACT_ID=$(echo "$ARTIFACTS_JSON" | jq -r '.artifacts[] | select(.name == "info-yml") | .id')
40+
41+
if [ -n "$INFO_ARTIFACT_ID" ] && [ "$INFO_ARTIFACT_ID" != "null" ]; then
42+
echo "Downloading info-yml artifact (ID: $INFO_ARTIFACT_ID)"
43+
44+
# Download the artifact
45+
curl -L -H "Authorization: token ${{ secrets.GH_ISSUE_CREATOR_TOKEN }}" \
46+
"https://github.siemens.cloud/api/v3/repos/${{ inputs.repository }}/actions/artifacts/$INFO_ARTIFACT_ID/zip" \
47+
-o info-yml.zip
48+
49+
# Extract the zip file
50+
unzip -q info-yml.zip
51+
52+
if [ -f "info.yml" ]; then
53+
echo "Successfully downloaded and extracted info.yml"
54+
cat info.yml
55+
else
56+
echo "Warning: info.yml not found in artifact"
57+
touch info.yml # Create empty file as fallback
58+
fi
59+
else
60+
echo "Warning: info-yml artifact not found, creating empty info.yml"
61+
touch info.yml
62+
fi
63+
64+
# Create GitHub issue using the new comprehensive action
65+
- name: Create Assessment Notification Issue
66+
uses: simatic-ax/internal-actions/create-assessment-issue@v1
67+
with:
68+
run_id: ${{ inputs.run_id }}
69+
info_file: info.yml
70+
github_token: ${{ secrets.GH_ISSUE_CREATOR_TOKEN }}
71+
repository: ${{ inputs.repository }}
72+
actor: ${{ inputs.actor }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.apax
2+
.env
3+
bin
4+
5+
obj
6+
testresult

.tours/additional_information.tour

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "https://aka.ms/codetour-schema",
3+
"title": "Additional information",
4+
"steps": [
5+
{
6+
"title": "Introduction",
7+
"description": "# Welcome\r\n\r\nThis tour contains additional information for the basic and advanced ST tour."
8+
},
9+
{
10+
"title": "Elementary data types",
11+
"description": "# Elementary data types\r\nThe following elementary data types are supported: \r\n \r\n| Type\t\t\t\t| Literal example\t\t\t\t | Domain range\t\t\t\t |Size\t\t\t | Default\t\t\t\t |\r\n| :---------------- | :------------------------------ | :----------------------------- | :---------------- | :------------------------ |\r\n| BOOL\t\t\t\t| TRUE\t\t\t\t\t\t\t | 0 ‥ 1\t\t\t\t\t\t | 1 bit unsigned\t | FALSE |\r\n| BYTE\t\t\t\t| BYTE#2#1111_0101\t\t\t\t | 0 ‥ 255\t\t\t\t\t\t | 8 bit unsigned\t | 0 |\r\n| WORD\t\t\t\t| WORD#60000\t\t\t\t\t | 0 ‥ 65535\t\t\t\t\t | 16 bit unsigned | 0 |\r\n| DWORD\t\t\t\t| DWORD#16#ABCD_EF01\t\t\t | 0 ‥ 4294967295\t\t\t\t | 32 bit unsigned | 0 |\r\n| LWORD\t\t\t\t| LWORD#55\t\t\t\t\t\t | 0 ‥ 18446744073709551615\t | 64 bit unsigned | 0 |\r\n| SINT\t\t\t\t| SINT#-5\t\t\t\t\t\t | -128 ‥ 127\t\t\t\t\t | 8 bit signed\t | 0 |\r\n| INT\t\t\t\t| -5\t\t\t\t\t\t\t | -32768 ‥ 32767\t\t\t\t | 16 bit signed\t | 0 |\r\n| DINT\t\t\t\t| DINT#-56\t\t\t\t\t\t | –2147483648 ‥ 2147483647\t | 32 bit signed\t | 0 |\r\n| LINT\t\t\t\t| LINT#512\t\t\t\t\t\t | -9223372036854775808 ‥ \t | | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | 9223372036854775807\t\t\t | 64 bit signed\t | 0 |\r\n| USINT\t\t\t\t| USINT#5\t\t\t\t\t\t | 0 ‥ 255\t\t\t\t\t\t | 8 bit unsigned\t | 0 |\r\n| UINT\t\t\t\t| UINT#512\t\t\t\t\t\t | 0 ‥ 65535\t\t\t\t\t | 16 bit unsigned | 0 |\r\n| UDINT\t\t\t\t| UDINT#512\t\t\t\t\t | 0 ‥ 4294967295\t\t\t\t | 32 bit unsigned | 0 |\r\n| ULINT\t\t\t\t| ULINT#512\t\t\t\t\t | 0 ‥ 18446744073709551615\t | 64 bit unsigned | 0 |\r\n| REAL\t\t\t\t| REAL#5.0\t\t\t\t\t\t | -3.402823e+38 ‥ \t | | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | +3.402823e+38\t\t\t\t | 32 bit (23 bit | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | \t\t\t\t\t\t\t | significant, | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | \t\t\t\t\t\t\t | 8 bit exponent) | 0.0 |\r\n| LREAL\t\t\t\t| 3.14159\t\t\t\t\t\t | -1.79769313486231e+308 ‥ \t | | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | 1.79769313486231e+308\t\t | 64 bit (52 bit | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | \t\t\t\t\t\t\t | significant, | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | \t\t\t\t\t\t\t | 11 bit exponent) | 0.0 |\r\n| TIME\t\t\t\t| TIME#12d2h4m8s16ms\t\t\t | –9223372036854ms ‥ \t | | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | 9223372036854ms\t\t\t\t | 64 bit signed\t | TIME#0ms |\r\n| LTIME\t\t\t\t| LTIME#100000d2h4m8s16ms32ns\t | -9223372036854775808ns ‥ \t | | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | 9223372036854775807ns\t\t | 64 bit signed\t | LTIME#0ns |\r\n| DATE\t\t\t\t| DATE#1980-01-23\t\t\t\t | 1970-01-01 ‥ 2262-04-11\t\t | 64 bit signed\t | DATE#1970-01-01 |\r\n| LDATE\t\t\t\t| LDATE#1980-01-23\t\t\t\t | 1970-01-01 ‥ 2262-04-11\t\t | 64 bit signed\t | LDATE#1970-01-01 |\r\n| TIME_OF_DAY\t\t| TOD#13:14:33.123\t\t\t\t | 0:0:0.0 ‥ \t | \t | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | 23:59:59.999999999\t\t\t | 64 bit signed\t | TOD#0:0:0.0 |\r\n| LTIME_OF_DAY\t\t| LTOD#13:14:33.123456\t\t\t | 0:0:0.0 ‥ \t | \t | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | 23:59:59.999999999\t\t\t | 64 bit signed\t | LTOD#0:0:0.0 |\r\n| DATE_AND_TIME\t\t| DT#1980-01-23-13:14:33.123\t | 1970-01-01-0:0:0.0 ‥ \t | \t | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | 2262-04-11-23:47:16.854775807 | 64 bit signed\t | DT#1970-01-01-0:0:0.0 |\r\n| LDATE_AND_TIME\t| LDT#1980-01-23-13:14:33.123456 | 1970-01-01-0:0:0.0 ‥ | | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t | 2262-04-11-23:47:16.854775807 | 64 bit signed\t | LDT#1970-01-01-0:0:0.0 |\r\n| CHAR\t\t\t\t| CHAR#'C'\t\t\t\t\t\t | 0 ‥ 255\t\t\t\t\t\t | 8 bit\tCHAR#0 | |\r\n| WCHAR\t\t\t\t| WCHAR#\"W\"\t\t\t\t\t \t | 0 ‥ 65535\t\t\t\t\t | 16 bit\tWCHAR#0 | |\r\n| STRING\t\t\t| STRING#'ABC'\t\t\t\t\t | \t\t\t\t\t\t\t | 1-254 characters | '' |\r\n| WSTRING\t\t\t| WSTRING#\"ABC\"\t\t\t\t | \t\t\t\t\t\t\t | 1-16328 wide | |\r\n| \t\t\t\t\t| \t\t\t\t\t\t\t\t |\t\t\t\t\t\t\t\t | characters\t\t | \"\" |\r\n \r\nTo return to [Tour 1 - Global and IO variables][Basic ST#5] click the hyper-link.",
12+
"selection": {
13+
"start": {
14+
"line": 3,
15+
"character": 1
16+
},
17+
"end": {
18+
"line": 45,
19+
"character": 78
20+
}
21+
}
22+
}
23+
]
24+
}

0 commit comments

Comments
 (0)