Skip to content

Commit 4533c05

Browse files
committed
Initial Commit
0 parents  commit 4533c05

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed

Diff for: .devcontainer/devcontainer.json

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// For format details, see https://aka.ms/devcontainer.json
2+
{
3+
"name": "PowerShell GitHub Actions",
4+
"hostRequirements": {
5+
"cpus": 4
6+
},
7+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
8+
"image": "mcr.microsoft.com/devcontainers/dotnet",
9+
"features": {
10+
// Uncomment this if you need a newer version of PowerShell then what ships with the dotnet devcontainer
11+
"ghcr.io/devcontainers/features/powershell:1": {
12+
"version": "latest"
13+
}
14+
},
15+
// Allows our container to work in rootless mode which is more secure
16+
"containerUser": "vscode",
17+
"remoteUser": "vscode",
18+
// VSCode specific configuration
19+
"customizations": {
20+
"vscode": {
21+
"extensions": [
22+
"ms-vscode.powershell",
23+
"github.vscode-github-actions", // GitHub Actions support
24+
"ms-vscode-remote.remote-containers",
25+
"mhutchie.git-graph", // Simple Visual Git Interface
26+
"oderwat.indent-rainbow",
27+
"vscode-icons-team.vscode-icons",
28+
"TylerLeonhardt.vscode-inline-values-powershell",
29+
"usernamehw.errorlens",
30+
"chouzz.vscode-better-align"
31+
],
32+
"settings": {
33+
"editor.inlayHints.enabled": "offUnlessPressed",
34+
"extensions.ignoreRecommendations": true, // Suppresses a message about PowerShell stable because we use preview extension
35+
"git.autofetch": true,
36+
"powershell.codeFormatting.alignPropertyValuePairs": true,
37+
"powershell.codeFormatting.autoCorrectAliases": true,
38+
"powershell.codeFormatting.newLineAfterOpenBrace": true,
39+
"powershell.codeFormatting.openBraceOnSameLine": true,
40+
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
41+
"powershell.codeFormatting.preset": "OTBS",
42+
"powershell.codeFormatting.trimWhitespaceAroundPipe": true,
43+
"powershell.codeFormatting.useConstantStrings": true,
44+
"powershell.codeFormatting.useCorrectCasing": true,
45+
"powershell.codeFormatting.whitespaceBetweenParameters": true,
46+
"powershell.powerShellDefaultVersion": "PowerShell",
47+
"terminal.integrated.defaultProfile.linux": "pwsh",
48+
"workbench.iconTheme": "vscode-icons"
49+
}
50+
}
51+
}
52+
}

Diff for: LICENSE

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# MIT License
2+
3+
Copyright (c) 2024 Justin Grote @JustinWGrote
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
23+
---
24+
25+
## [Your First Module in CSharp](https://github.com/PalmEmanuel/YourFirstPSModuleInCSharp): Selected Content
26+
27+
MIT License
28+
29+
Copyright (c) 2023 Emanuel Palm
30+
31+
Permission is hereby granted, free of charge, to any person obtaining a copy
32+
of this software and associated documentation files (the "Software"), to deal
33+
in the Software without restriction, including without limitation the rights
34+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35+
copies of the Software, and to permit persons to whom the Software is
36+
furnished to do so, subject to the following conditions:
37+
38+
The above copyright notice and this permission notice shall be included in all
39+
copies or substantial portions of the Software.
40+
41+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47+
SOFTWARE.

Diff for: README.MD

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Creating GitHub Actions with PowerShell
2+
3+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/JustinGrote/PowerShellGithubActions?quickstart=1)
4+
5+
This is a demo of how to develop custom GitHub Actinos in PowerShell. This repository is the companion to the PSConfEU 2024 Presentation **Building Custom GitHub Actions in PowerShell**
6+
7+
## Follow Along Setup
8+
9+
If you run into any problems with this setup feel free to reach out to @JustinWGrote on Twitter/X or file an issue in this repository.
10+
11+
[GitHub Codespaces](https://github.com/features/codespaces) provides a complete preconfigured development environment that runs in GitHub. GitHub provides all users 60 hours a month of free usage. You do not even need Visual Studio Code **installed** locally, it can run within your browser.
12+
13+
### Steps
14+
15+
1. [Sign up for a GitHub account](https://github.com/join) if you do not already have one. It is free to join.
16+
1. Open our codespaces quickstart link in the browser of your choice (Edge/Chrome recommended)
17+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/JustinGrote/PowerShellGithubActions?quickstart=1)
18+
1. Click `Create new codespace` when prompted. You can optionally click `Change Options` and customize some aspects of the codespace such as the number of CPUs. This repo is preconfigured with 4 cores. While 2 core is totally sufficient for Github Action editing, we are using 4 for this demo to reduce startup and build time and generally avoid lag due to time constraints.
19+
1. If you have Visual Studio Code installed, it will prompt you to open a link in Visual Studio code to connect to your codespace, otherwise the web version of Visual Studio Code will open in your browser and connect to the codespace.
20+
1. The codespace may take several minutes to load.
21+
1. **Congratulations!** You are now ready to start your GitHub Action development journey.
22+
23+
### Option 2: Devcontainer
24+
25+
This is an option if you wish to work "offline". It does not require a GitHub account, though we still recommend a GitHub Account as you will not be able to make pull requests to test the lab exercises or run GitHub Actions without one.
26+
27+
1. Follow the [Dev Containers Tutorial](https://code.visualstudio.com/docs/devcontainers/tutorial) to setup devcontainers on your local computer.
28+
1. Clone the Github Repository (https://codespaces.new/JustinGrote/PowerShellGithubActions) to a local folder and then open it in Visual Studio Code
29+
1. You should be prompted to reopen the project in a devcontainer.
30+
1. Once the codespace loads, you will likely see a warning about the C# prerelease being required. Go ahead and click Upgrade to reload the codespace. This is due to the new C# Dev Kit extension and this message will stop occuring once it becomes generally available.
31+
![Alt text](images/README/image-2.png)
32+
1. **Congratulations!** You are now ready to start your Github Action- development journey.
33+
34+
### Option 3: Local Development
35+
36+
If you prefer local development, or are in a controlled environment without access to Docker or Codespaces, you can simply clone this GitHub repository and work locally. You will need to manually install PowerShell, .NET Core, and all the relevant extensions. **This is not recommended**
37+
38+
## Customizati

0 commit comments

Comments
 (0)