64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/Assets/themedata.thmx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Azure/actions/aa72221ae06ca0669df28de5f11f4ce5b0f8dae4/Assets/themedata.thmx
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Microsoft Open Source Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4 |
5 | Resources:
6 |
7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation.
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Actions - [GitHub Actions for Azure](https://azure.github.io/actions/)
2 |
3 | This repository provides a framework, guidelines and processes to author new and contribute to existing [GitHub Actions deploying to Azure](https://azure.github.io/actions/).
4 |
5 | ## Table of contents
6 | - [Introduction to GitHub Actions for Azure and Starter Action Workflows](#introduction-to-github-actions-for-azure-and-starter-action-workflows)
7 | - [Contributing to Azure Actions](#introduction-to-github-actions-for-azure-and-starter-action-workflows)
8 | - [Health Dashboard for Azure Action repos](https://azure.github.io/actions/health-dashboard.html)
9 |
10 | # Introduction to GitHub Actions for Azure and Starter Action Workflows
11 |
12 | [GitHub Actions](https://help.github.com/en/articles/about-github-actions) gives you the flexibility to build an automated software development lifecycle workflow.
13 |
14 | With [GitHub Actions for Azure](https://azure.github.io/actions/) you can create workflows that you can set up in your repository to build, test, package, release and **deploy** to Azure. [Learn more about all other integrations with Azure.](http://aka.ms/GitHubonAzure)
15 |
16 | Get started today with a [free Azure account](https://azure.com/free/open-source)!
17 |
18 | To easily create GitHub CI/CD workflows targeting Azure, use our [Azure starter templates](https://github.com/Azure/actions-workflow-samples) to deploy your apps created with popular languages and frameworks such as .NET, Node.js, Java, PHP, Ruby or Python, in containers or running on any operating system. Also the individual Action repos have a sample workflow included in their Readme file to help you quickly get started.
19 |
20 | Please try out the [GitHub Actions for Azure](https://docs.microsoft.com/azure/developer/github/github-actions) and share your feedback via Twitter on [@Azure](https://twitter.com/azuredevops). If you encounter a problem, please open an issue on the GitHub repository for the specific action.
21 |
22 | # Contributing to Azure Actions
23 |
24 | Following are the guideliens to author new Azure Actions and also to contribute to the existing ones.
25 | ### Authoring and making changes
26 | - [Create a new GitHub Action for Azure or Microsoft](docs/Process_of_Authoring_GitHub_Actions_for_Azure.md#creating-a-new-github-action-for-azure-or-microsoft)
27 | - [Contributing to the existing actions](docs/developer-guildelines.md)
28 | - [Building GitHub Actions from Azure Pipeline Tasks](docs/action-from-pipeline-task.md)
29 |
30 | ### Actions Repository Permissions
31 | - [Guidelines for repository permissions](docs/Process_of_Authoring_GitHub_Actions_for_Azure.md#guidelines-for-setting-permissions-on-the-repo)
32 |
33 | ### Testing
34 | - [Testing GitHub Actions](docs/Testing-docs/Testing-GitHub-Actions.md)
35 | - [Automated test workflows](docs/Testing-docs/Test-workflows-automation.md)
36 | - [Automates tests for updated runner images](docs/Testing-docs/Runner-infra-tests.md)
37 | - [Automatic Validation of recommended practices for an Actions repository](docs/validations-action-repo.md)
38 |
39 | ### Release
40 | - [Action Versioning](docs/Process_of_Authoring_GitHub_Actions_for_Azure.md#action-versioning)
41 | - [Releasing a new version](docs/release-process.md)
42 | - [Publish to Marketplace](docs/Process_of_Authoring_GitHub_Actions_for_Azure.md#publish-the-action-to-marketplace)
43 | - [Communication guidelines](communication%20guidelines.md)
44 | ### Monitoring
45 | The below app integrations can be used to subscribe to the events like issues and PRs of an action repository for monitoring.
46 | - [Slack integration](https://github.com/integrations/slack#subscribing-and-unsubscribing)
47 | - [MS-Teams integration](https://github.com/integrations/microsoft-teams)
48 |
49 | ## Azure Actions toolkit
50 | [Azure Actions toolkit](https://github.com/Azure/actions-toolkit) hosting node modules to help write your azure actions
51 |
52 | ## Health Dashboard for Azure Action repos
53 |
54 | This [health dashboard](https://azure.github.io/actions/health-dashboard.html) provides information on open issues and PRs for all the Azure Action repos. These are the [steps](docs/onboarding-to-dashboard.md) that can be followed to onboard any action on the dashboard.
55 | We are also planning add a feature to highlight any dip in the action specific usage telemetry in the dashboard.
56 |
57 | ## Contributing License Agreement
58 |
59 | This project welcomes contributions and suggestions. Most contributions require you to agree to a
60 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
61 | the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
62 |
63 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide
64 | a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
65 | provided by the bot. You will only need to do this once across all repos using our CLA.
66 |
67 | # Code of Conduct
68 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
69 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
70 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
71 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Security
4 |
5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6 |
7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
8 |
9 | ## Reporting Security Issues
10 |
11 | **Please do not report security vulnerabilities through public GitHub issues.**
12 |
13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
14 |
15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
16 |
17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
18 |
19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20 |
21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22 | * Full paths of source file(s) related to the manifestation of the issue
23 | * The location of the affected source code (tag/branch/commit or direct URL)
24 | * Any special configuration required to reproduce the issue
25 | * Step-by-step instructions to reproduce the issue
26 | * Proof-of-concept or exploit code (if possible)
27 | * Impact of the issue, including how an attacker might exploit the issue
28 |
29 | This information will help us triage your report more quickly.
30 |
31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
32 |
33 | ## Preferred Languages
34 |
35 | We prefer all communications to be in English.
36 |
37 | ## Policy
38 |
39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
40 |
41 |
42 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-architect
--------------------------------------------------------------------------------
/azure-logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/communication guidelines.md:
--------------------------------------------------------------------------------
1 | ## Purpose:
2 | [GitHub Actions](https://docs.github.com/en/actions/learn-github-actions) gives you the flexibility to build an automated software development lifecycle workflow. With [GitHub Actions for Azure](https://docs.microsoft.com/en-gb/azure/developer/github/) you can create workflows that you can set up in your repository to build, test, package, release and deploy to Azure
3 | This document is to set communication guidelines for making GitHub Actions ready for the external community. We want to set a robust framework for communication, and governance for anything related to GitHub Actions for Azure, for enabling both internal and external users to be always updated on any change in this area.
4 |
5 | ## Ground Rules for Communication:
6 | 1. Any form of communciation should abide by the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
7 | 2. We would use GitHub aliases for all the communication
8 | 3. We would want all communication to be public.
9 |
10 | ## What should be communicated:
11 | 1. Anything that is relevant to external developers
12 | 2. Common utilities
13 | 3. Guidelines for contribution
14 | 4. Test and Test strategy
15 | 5. Versioning & Publishing Guidelines
16 | 6. Discussions related to issues & features
17 | 7. Roadmap & milestone planning
18 |
19 | ## What should not be be included in Open Source Communications:
20 | 1. Individual contact information or internal channel information (anything that is related to PII)
21 | 2. Internal processes that are not relevant or will not be used by external developers
22 | 3. Internal discussions and decisions on formulating open source guidelines
23 | 4. Any internal links that are not accessible to the community
24 |
25 | ## Entities involved:
26 | #### 1. ACE team:
27 | Team responsible for building infrastructure & platform, maintaining and advocating Actions for Azure. This is us.
28 | > a. DL - ace-team@github.com
29 |
30 | > b. GitHub Team handles -GitHub org, Azure Org, MS Org
31 |
32 | #### 2. ACE Steering Committee:
33 | Steering body for the Azure Actions. This should be ACE Team + key stakeholders from Azure & MS. Ex for all the key decision making for Azure Actions it would be ACE Team + Key Stakeholders from Azure.
34 | > a) This can have folks from the MS team or community.
35 |
36 | > b) Need to have a Teams channel for each org (for internal communication between ACE Team & MS Partner Team). Need github handles & MS email ids for these members
37 |
38 | > c) Need Team handles for these - would be used for tagging in any communication with Azure org/MS org, code reviews etc
39 |
40 | #### 3. Action Maintainer Group:
41 | For each Action, the Action maintainer group would include ACE Team + Owners of the specific Action. The owners would be decided by the team who creates the Action.
42 |
43 | ## Communication scenarios:
44 |
45 | | New Feature Req/Support Requests | Create an issue in | Assignee|
46 | | ----------- | ----------- |------------|
47 | | Related to existing GH Platform features | Actions Repo | ACE Team |
48 | | Functionality, Security & Compliance of a specific Action | The Specific Actions Repo | Action Maintainer Group |
49 | | Code of Conduct violation related to a specific Action | Actions Repo | ACE Steering Committee |
50 | | Related to ACE Guidance and Libraries | Actions Repo | ACE Steering Committee |
51 |
52 | ## How will ACE Team communicate with the community/partner teams:
53 | 1. Roadmap & Milestones
54 | 2. Release notes to community which would include
55 | > a. Breaking update or security related or regular update.
56 |
57 | > b. New Action/New version Announcements
58 | 3. Action Mantainers Group about :
59 | > a. Breaking changes
60 |
61 | > b. Security changes
62 |
63 | > c.Regular updates
64 |
65 | ## Administrative scenarios (will be taken care by Team handles, no action item)
66 | 1. Employee leaving
67 | 2. Change in maintainer, escalation contact points
68 | 3. Change in ACE and steering team.
69 | 4. Change in ACE Team members
70 |
71 | ## Guiding principles
72 | 1. Communication open to the public is better than private only communication.
73 | 2. Communication should remain available even if people change.
74 | 3. Issues, discussion or chatops channels remain available.
75 | 4. Communication should be automated. Bots based communication have better acceptance.
76 |
--------------------------------------------------------------------------------
/dashboard-config/health-dashboard-config.yml:
--------------------------------------------------------------------------------
1 | title: "Health Dashboard"
2 | output:
3 | format: html
4 | filename: "docs/health-dashboard.html"
5 | setup: |
6 | const repos = 'repo:Azure/login repo:Azure/appservice-settings repo:Azure/webapps-deploy repo:Azure/aci-deploy repo:build-vm-image repo:Azure/functions-action repo:Azure/functions-container-action repo:Azure/mysql repo:Azure/postgresql repo:Azure/powershell repo:Azure/sql-action repo:Azure/policy-compliance-scan repo:Azure/k8s-create-secret repo:Azure/k8s-lint repo:Azure/k8s-deploy repo:Azure/manage-azure-policy repo:Azure/setup-kubectl repo:Azure/k8s-bake repo:Azure/aks-set-context repo:Azure/k8s-set-context repo:Azure/setup-helm repo:Azure/docker-login repo:Azure/static-web-apps-deploy repo:Azure/AppConfiguration-Sync repo:Azure/arm-deploy repo:Azure/cli repo:Azure/load-testing'
7 | userdata.count = async function(itemType,label) {
8 | var results
9 | if(label === "") {
10 | if(itemType === "issue") {
11 | results = await github.search.issuesAndPullRequests(
12 | { q: `${repos} is:${itemType} is:open -label:enhancement`}
13 | )
14 | }
15 | else {
16 | results = await github.search.issuesAndPullRequests(
17 | { q: `${repos} is:${itemType} is:open`}
18 | )
19 | }
20 | }
21 | else if(label === "closed") {
22 | results = await github.search.issuesAndPullRequests(
23 | { q: `${repos} is:${itemType} is:closed closed:>${date("-30 days")}`}
24 | )
25 | }
26 | else if(label === "others") {
27 | results = await github.search.issuesAndPullRequests(
28 | { q: `${repos} is:${itemType} is:open -label:enhancement -label:P0 -label:P1`}
29 | )
30 | }
31 | else if(label === "active") {
32 | results = await github.search.issuesAndPullRequests(
33 | { q: `${repos} is:${itemType} is:open -label:enhancement created:>${date("-30 days")}`}
34 | )
35 | }
36 | else if(label === "stale") {
37 | results = await github.search.issuesAndPullRequests(
38 | { q: `${repos} is:${itemType} is:open -label:enhancement created:<${date("-30 days")}`}
39 | )
40 | }
41 | else{
42 | results = await github.search.issuesAndPullRequests(
43 | { q: `${repos} is:${itemType} is:open label:${label}`}
44 | )
45 | }
46 | if(results.data.items.length === 0){
47 | return '0'
48 | }
49 | else{
50 | return results.data.total_count
51 | }
52 | }
53 |
54 | userdata.url = async function(itemType,label) {
55 | var today = new Date();
56 | var pastDate = new Date(today);
57 | var url, closedDate, staleDate;
58 |
59 | if(label === "") {
60 | if(itemType === "issue") {
61 | url = 'https://github.com/search?q='+ repos + '+is%3A'+ itemType + '+is%3Aopen' + ' -label%3Aenhancement'
62 | }
63 | else {
64 | url = 'https://github.com/search?q='+ repos + '+is%3A'+ itemType + '+is%3Aopen'
65 | }
66 | }
67 | else if(label === "closed") {
68 | pastDate.setDate(pastDate.getDate() - 30);
69 | closedDate = pastDate.toISOString().split("T")[0];
70 | url = 'https://github.com/search?q='+ repos + '+is%3A'+ itemType + '+is%3Aclosed' + '+closed%3A>'+ closedDate
71 | }
72 | else if(label === "others") {
73 | url = 'https://github.com/search?q='+ repos + '+is%3A'+ itemType + '+is%3Aopen' + ' -label%3Aenhancement' + ' -label%3AP0' + ' -label%3AP1'
74 | }
75 | else if(label === "active") {
76 | pastDate.setDate(pastDate.getDate() - 30);
77 | staleDate = pastDate.toISOString().split("T")[0];
78 | url = 'https://github.com/search?q=' + repos + '+is%3A' + itemType + '+is%3Aopen' + '+created%3A>'+ staleDate
79 | }
80 | else if(label === "stale") {
81 | pastDate.setDate(pastDate.getDate() - 30);
82 | staleDate = pastDate.toISOString().split("T")[0];
83 | url = 'https://github.com/search?q=' + repos + '+is%3A' + itemType + '+is%3Aopen' + '+created%3A<'+ staleDate
84 | }
85 | else{
86 | url = 'https://github.com/search?q='+ repos + '+is%3A'+ itemType + '+is%3Aopen' + '+label%3A' + label
87 | }
88 | return url
89 | }
90 | userdata.getTimeStamp = async function(itemType,label) {
91 | var today = new Date();
92 | var utcTime = today.getTime() + (today.getTimezoneOffset() * 60000);
93 | var istTime = new Date(utcTime + (3600000*5.5));
94 | return istTime.toLocaleString();
95 | }
96 |
97 | sections:
98 | - title: "Issues"
99 | widgets:
100 | - type: "number"
101 | title: "Open (Excluding enhancements)"
102 | value: '{{ userdata.count("issue","") }}'
103 | url: '{{ userdata.url("issue","") }}'
104 | color: 'yellow'
105 | - type: "number"
106 | title: "Closed (last 30 days)"
107 | value: '{{ userdata.count("issue","closed") }}'
108 | url: '{{ userdata.url("issue","closed") }}'
109 | color: 'green'
110 |
111 | - title: "Open Issues by Priority"
112 | widgets:
113 | - type: "number"
114 | title: "P0 bugs"
115 | value: '{{ userdata.count("issue","P0") }}'
116 | url: '{{ userdata.url("issue","P0") }}'
117 | color: 'yellow'
118 | - type: "number"
119 | title: "P1 bugs"
120 | value: '{{ userdata.count("issue","P1") }}'
121 | url: '{{ userdata.url("issue","P1") }}'
122 | color: 'yellow'
123 | - type: "number"
124 | title: "Others"
125 | value: '{{ userdata.count("issue","others") }}'
126 | url: '{{ userdata.url("issue","others") }}'
127 | color: 'yellow'
128 |
129 | - title: "Open Issues by Age"
130 | widgets:
131 | - type: "number"
132 | title: "Active"
133 | value: '{{ userdata.count("issue","active") }}'
134 | url: '{{ userdata.url("issue","active") }}'
135 | color: 'yellow'
136 | - type: "number"
137 | title: "Stale (30 days old)"
138 | value: '{{ userdata.count("issue","stale") }}'
139 | url: '{{ userdata.url("issue","stale") }}'
140 | color: 'yellow'
141 |
142 | - title: "Enhancements"
143 | widgets:
144 | - type: "number"
145 | title: "Enhancements"
146 | value: '{{ userdata.count("issue","enhancement") }}'
147 | url: '{{ userdata.url("issue","enhancement") }}'
148 |
149 | - title: "Pull Requests"
150 | widgets:
151 | - type: "number"
152 | title: "Open"
153 | value: '{{ userdata.count("pr","") }}'
154 | url: '{{ userdata.url("pr","") }}'
155 | color: 'yellow'
156 | - type: "number"
157 | title: "Stale (30 days old)"
158 | value: '{{ userdata.count("pr","stale") }}'
159 | url: '{{ userdata.url("pr","stale") }}'
160 | color: 'yellow'
161 | - type: "number"
162 | title: "Closed (last 30 days)"
163 | value: '{{ userdata.count("pr","closed") }}'
164 | url: '{{ userdata.url("pr","closed") }}'
165 | color: 'green'
166 |
167 | - title: "Details"
168 | widgets:
169 | - type: "string"
170 | value: "Issues detailed information"
171 | url: "issue.html"
172 | - type: "string"
173 | value: "PR detailed information"
174 | url: "pr.html"
175 | - type: "string"
176 | value: "Last updated : {{ userdata.getTimeStamp() }} IST"
177 | color: black
178 | - type: "string"
179 | value: "Click here to share feedback or raise queries"
180 | url: "https://github.com/Azure/actions/issues/new"
181 |
182 |
--------------------------------------------------------------------------------
/docs/404.html:
--------------------------------------------------------------------------------
1 | ---
2 | permalink: /404.html
3 | layout: default
4 | ---
5 |
6 |
19 |
20 |
21 |
404
22 |
23 |
Page not found :(
24 |
The requested page could not be found.
25 |
26 |
--------------------------------------------------------------------------------
/docs/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 | # Hello! This is where you manage which Jekyll version is used to run.
3 | # When you want to use a different version, change it below, save the
4 | # file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
5 | #
6 | # bundle exec jekyll serve
7 | #
8 | # This will help ensure the proper Jekyll version is running.
9 | # Happy Jekylling!
10 | gem "jekyll", "~> 4.2.0"
11 | # This is the default theme for new Jekyll sites. You may change this to anything you like.
12 | gem "minima", "~> 2.5"
13 | # If you want to use GitHub Pages, remove the "gem "jekyll"" above and
14 | # uncomment the line below. To upgrade, run `bundle update github-pages`.
15 | # gem "github-pages", group: :jekyll_plugins
16 | # If you have any plugins, put them here!
17 | group :jekyll_plugins do
18 | gem "jekyll-feed", "~> 0.12"
19 | end
20 |
21 | # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
22 | # and associated library.
23 | platforms :mingw, :x64_mingw, :mswin, :jruby do
24 | gem "tzinfo", "~> 1.2"
25 | gem "tzinfo-data"
26 | end
27 |
28 | # Performance-booster for watching directories on Windows
29 | gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
30 |
31 |
--------------------------------------------------------------------------------
/docs/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | addressable (2.7.0)
5 | public_suffix (>= 2.0.2, < 5.0)
6 | colorator (1.1.0)
7 | concurrent-ruby (1.1.7)
8 | em-websocket (0.5.2)
9 | eventmachine (>= 0.12.9)
10 | http_parser.rb (~> 0.6.0)
11 | eventmachine (1.2.7)
12 | ffi (1.14.2)
13 | forwardable-extended (2.6.0)
14 | http_parser.rb (0.6.0)
15 | i18n (1.8.5)
16 | concurrent-ruby (~> 1.0)
17 | jekyll (4.2.0)
18 | addressable (~> 2.4)
19 | colorator (~> 1.0)
20 | em-websocket (~> 0.5)
21 | i18n (~> 1.0)
22 | jekyll-sass-converter (~> 2.0)
23 | jekyll-watch (~> 2.0)
24 | kramdown (~> 2.3)
25 | kramdown-parser-gfm (~> 1.0)
26 | liquid (~> 4.0)
27 | mercenary (~> 0.4.0)
28 | pathutil (~> 0.9)
29 | rouge (~> 3.0)
30 | safe_yaml (~> 1.0)
31 | terminal-table (~> 2.0)
32 | jekyll-feed (0.15.1)
33 | jekyll (>= 3.7, < 5.0)
34 | jekyll-sass-converter (2.1.0)
35 | sassc (> 2.0.1, < 3.0)
36 | jekyll-seo-tag (2.7.1)
37 | jekyll (>= 3.8, < 5.0)
38 | jekyll-watch (2.2.1)
39 | listen (~> 3.0)
40 | kramdown (2.3.1)
41 | rexml
42 | kramdown-parser-gfm (1.1.0)
43 | kramdown (~> 2.0)
44 | liquid (4.0.3)
45 | listen (3.3.3)
46 | rb-fsevent (~> 0.10, >= 0.10.3)
47 | rb-inotify (~> 0.9, >= 0.9.10)
48 | mercenary (0.4.0)
49 | minima (2.5.1)
50 | jekyll (>= 3.5, < 5.0)
51 | jekyll-feed (~> 0.9)
52 | jekyll-seo-tag (~> 2.1)
53 | pathutil (0.16.2)
54 | forwardable-extended (~> 2.6)
55 | public_suffix (4.0.6)
56 | rb-fsevent (0.10.4)
57 | rb-inotify (0.10.1)
58 | ffi (~> 1.0)
59 | rexml (3.2.5)
60 | rouge (3.26.0)
61 | safe_yaml (1.0.5)
62 | sassc (2.4.0)
63 | ffi (~> 1.9)
64 | terminal-table (2.0.0)
65 | unicode-display_width (~> 1.1, >= 1.1.1)
66 | unicode-display_width (1.7.0)
67 |
68 | PLATFORMS
69 | universal-darwin-20
70 | x86_64-linux
71 |
72 | DEPENDENCIES
73 | jekyll (~> 4.2.0)
74 | jekyll-feed (~> 0.12)
75 | minima (~> 2.5)
76 | tzinfo (~> 1.2)
77 | tzinfo-data
78 | wdm (~> 0.1.1)
79 |
80 | BUNDLED WITH
81 | 2.2.16
82 |
--------------------------------------------------------------------------------
/docs/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Stefan Cardenas
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 |
--------------------------------------------------------------------------------
/docs/Process_of_Authoring_GitHub_Actions_for_Azure.md:
--------------------------------------------------------------------------------
1 | # GitHub Actions
2 |
3 | [GitHub Actions](https://help.github.com/en/articles/about-github-actions) is a community-led and community-powered approach to enable developers to automate their code to cloud workflows directly from their repositories.
4 | There are now 6900+ community-developed actions available in [GitHub Marketplace](https://github.com/marketplace).
5 | Since releasing Actions in November 2017, GitHub partners including Cloud partners like AWS, Azure, Google, and many others have also contributed to this list to help developers (teams) to extend and automate workflows with their existing tools.
6 |
7 | # GitHub Actions for Azure
8 | [GitHub Actions for Azure](https://github.com/Azure/actions) are released to GitHub Marketplace for creating workflows to package, release, and deploy apps to [Azure](https://azure.microsoft.com/) from GitHub. These actions enable developers to target the breadth of Azure services, from Web Apps to serverless Functions, as well as Azure SQL and MySQL databases. We also released Actions for building and deploying container-based applications that work with Docker and Kubernetes on any environment and cloud, in addition to their managed Azure Kubernetes Service.
9 |
10 | To help GH developers easily create GitHub CI/CD workflows targeting Azure, we also published [Azure starter templates](https://github.com/Azure/actions-workflow-samples) to deploy apps created with popular languages and frameworks such as .NET, Node.js, Java, PHP, Ruby or Python, in containers or running on any operating system.
11 |
12 | GitHub Actions for Azure are also integrated into Visual Studio Code, Azure CLI, and the Azure Portal simplifying the experience of [deploying to Azure from your favorite tools.](https://azure.microsoft.com/en-us/blog/deploy-to-azure-using-github-actions-from-your-favorite-tools/)
13 |
14 | This document is intended to help developers with the recommended process to create, publish and contribute to actions for Azure. Please reach out to the [ACE Team](mailto:ace-team@github.com) for any queries.
15 |
16 | # Creating a new GitHub Action for Azure or Microsoft
17 |
18 | You can [create your own actions](https://docs.github.com/en/free-pro-team@latest/actions/creating-actions), use and customize actions shared by the GitHub community, or write and share the actions you build.
19 |
20 | This guidance is to enable developers and teams intending to create a new GitHub Action targeting Azure.
21 |
22 | ## Before you author
23 |
24 | - Kindly confirm that the new action would enable a new developer scenario that can **not** be accomplished by the existing set of [Actions for Azure](https://github.com/marketplace?type=actions&query=Azure) or by enhancing them through contributions.
25 | - Ensure that only one action is present per repo. Create new repo for each of your actions.
26 |
27 | ## Steps to create a new Action repo
28 |
29 | If you are a Microsoft employee,
30 |
31 | 1. Choose the right GitHub org to create a repo. For example, for all Actions targeting an Azure service, choose [https://github.com/Azure/](https://github.com/Azure/) as the Org. Else for any generic utility actions which are cloud agnostic, chose [https://github.com/Microsoft](https://github.com/Microsoft) as the org for hosting the Action repo.
32 |
33 | 2. Request a new repo from the below links as suitable:
34 | - [https://repos.opensource.microsoft.com/orgs/Azure/new](https://repos.opensource.microsoft.com/Azure) for creating repos under github.com/Azure Org
35 | - [https://repos.opensource.microsoft.com/orgs/Microsoft/new](https://repos.opensource.microsoft.com/microsoft) for creating repos under github.com/Microsoft Org
36 |
37 | Ensure to select **Engineering system: GitHub for Open Source** as GitHub Actions for Azure or Microsoft are published as Open Source in repos created in
38 | Microsoft's official GitHub.com organizations, powered by GitHub Enterprise Cloud.
39 |
40 | 3. Alternatively, Microsoft users who might already have required permissions on github.com/azure and github.com/Microsoft orgs could just directly create a repo in the respective org without going through the above open-source portal URLs.
41 |
42 | Either-ways, there is an Open Source compliance request that automatically gets created at the end of the repo creation step. Creators receive an e-mail to complete the additional steps required to complete the setup process.
43 |
44 | If you are an external (non-Microsoft) contributor, you could either raise PRs to the existing Actions in Azure &n Microsoft Orgs or create new action repos in your individual GitHub orgs and can reach out to the [ACE Team](mailto:ace-team@github.com) for any guidance.
45 |
46 | ## Guidelines for setting permissions on the repo
47 | Once the repo is created, following is the permission model that is followed across various action repos within the [**Azure**](https://github.com/Azure) and [**Microsoft**](https://github.com/Microsoft) GitHub orgs:
48 |
49 | - [actions-admin](https://github.com/orgs/Azure/teams/actions-admin/members) team would be added with "admin" role to every new GH repo created for authoring any new action under the Azure org (github.com/azure/). This will ensure that ACE team can act in admin role to ensure that the process guidelines for authoring & publishing the actions are completely followed.
50 |
51 | - Owners of the individual actions could manage the "maintainer" permissions for their teams by [creating a new github team handle](https://github.com/orgs/Azure/new-team) for their crews and adding this handle with "admin"/"maintainer" role as needed.
52 |
53 | **Note:** It is recommended that team handles are used for maintaining permissions instead of adding individual member's github handles.
54 |
55 | - Kindly request the corresponding Azure product teams to include their team handle as "Admins"/"Maintainers" to facilitate raising any commits from their side for feature enhancements or for fixing supportability issues
56 |
57 |
58 | ## ReadMe.md & action.yml files
59 |
60 | Once the Action development is complete, ensure that it is documented well in the **readme.md** file at the root of the repo of the Master branch. Please note that this content is used when the Action is published to the GitHub Marketplace. Hence including a sample workflow which covers the best usage of the Action is always recommended.
61 |
62 | Also ensure that the **action.yml** is present in the root of the repo and has the Action name & description well defined. Also choose the icon & color suitably under branding as these are used when the Action is listed in Marketplace catalog.
63 |
64 | Note: All actions published from **Azure** GitHub org are branded using the Azure icon irrespective of the icon used in the action.yml. This is to leverage the recall value of Azure brand and icon as compared to the individual icons of various Azure services.
65 |
66 | ## Action Versioning
67 |
68 | **Versioning Guidance for GH actions that should be adhered to before a new action or an enhancement to an existing action is released:**
69 |
70 | Official Release Management Guidance from GH platform team: https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/about-actions#using-release-management-for-actions
71 |
72 | **Note:** Introduce a new major version of the branch (releases/v2) and tag (v2) if changes break the existing workflows using the previous version. In case of Minor version releases, ensure to move the major version tag to always point to the most recent minor version tag to ensure all the existing users of the major version would automatically gain the benefits from the new enhancements added in the minor version release.
73 |
74 |
75 | ## Publish the action to Marketplace
76 |
77 | ### Pre-requisites:
78 |
79 | - Ensure that the Legal OSS approval process for the repo is complete. Search for the status of the work item created with your repo name here: https://ossmsft.visualstudio.com/Reviews/\_workitems/ .
80 |
81 | "DO NOT PUBLISH THE ACTION TO THE MARKETPLACE UNTIL LEGAL REVIEW IS COMPLETE"
82 |
83 | - Versioning guidelines mentioned above section are adhered to and you have a version tag
84 | - Well documented readme.md is in place at the root of the repo
85 | - V-team is involved for review process and sign off by mailing @[ACE team Alias](mailto:ace-team@github.com)
86 |
87 | Finally [publish the action to GitHub Marketplace](https://docs.github.com/free-pro-team@latest/actions/creating-actions/publishing-actions-in-github-marketplace)
88 | - Typically for all actions intended to "deploy to Azure", we mark Primary Category as "Deployment"
89 | - Secondary Category can be chosen based on the intent of the Action
90 | - Give a suitable release title and write up. Tip: Include a sample workflow and License details
91 | - "Publish release"
92 | - Navigate to [https://github.com/marketplace?type=actions](https://github.com/marketplace?type=actions) and search for your Action to ensure everything shown is as needed.
93 |
94 | ### Include a starter template in the [Azure/actions-workflow-sample](https://github.com/Azure/actions-workflow-samples)s repo
95 |
96 | Various starter templates are made available to help users easily get started with GitHub Actions for Azure and deploy their apps created with popular languages and frameworks such as .NET, Node.js, Java, PHP, Ruby, or Python in containers or running on any operating system.
97 |
98 | It is recommended that a suitable workflow template is added to this repo: [https://github.com/Azure/actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) by raising a PR into the relevant folder.
99 |
100 | For more help, please reach out to @[ACE Team Alias](mailto:ace-team@github.com)
101 |
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # github-actions
2 | Github Actions - Jekyll Website
3 |
4 | ### Requirements to run:
5 | 1. Install [Docker](https://docs.docker.com/get-docker/).
6 |
7 | The home page already has the following libraries included:
8 | 1. [Bootstrap](https://getbootstrap.com/)
9 | 2. [Animate.style](https://animate.style/)
10 | 3. [Wow.js](https://wowjs.uk/)
11 |
12 | If you need to load additional librari via the `head` you can include them in [`/_includes/addiional-head.html`](https://github.com/S-Cardenas/github-actions/blob/main/_includes/additional-head.html).
13 |
14 | ### Quickstart:
15 | 1. Run `docker-compose build && docker-compose up`
16 | 2. Visit [localhost:4000](http://localhost:4000) to view the home page. You can add all of your code here.
17 | 3. View an example static page at [localhost:4000/example](http://localhost:4000/example). This page has examples with [Bootstrap](https://getbootstrap.com/), [Animate.style](https://animate.style/) and [Wow.js](https://wowjs.uk/).
18 |
19 | Adding new HTML to the home page by modifying the [home layout](https://github.com/S-Cardenas/github-actions/blob/main/_layouts/home.html):
20 |
21 | ```
22 |
23 |
24 |
25 | {% include head.html %}
26 | {% include additional-head.html %}
27 |
28 |
29 |
30 |
Hello world. Home Page.
31 |
You can add all your code in here.
32 |
Bootstrap, animate.css and wow.js have already been included in the head of this HTML document.
33 |
:)
34 |
35 | {% include home-js.html %}
36 |
37 |
38 | ```
39 |
40 | Update the css that shows up on the home page by modifying the [home.css stylesheet](https://github.com/S-Cardenas/github-actions/blob/main/css/home.css):
41 | ```
42 | .my-custom-color {
43 | color: red;
44 | }
45 | ```
46 |
47 | Javascript can be added to the home page by adding it into the `_includes` file named [home-js.html](https://github.com/S-Cardenas/github-actions/blob/main/_includes/home-js.html).
48 |
49 | ```
50 |
54 | ```
55 |
56 | Usefule resources for using Jekyll:
57 | 1. [Official Jekyll Tutorial](https://jekyllrb.com/)
58 | 2. [Building Static Sites with Jekyll](https://programminghistorian.org/en/lessons/building-static-sites-with-jekyll-github-pages#running-a-website-locally-)
59 | 3. [Example Project](https://github.com/joeltennant/Jekyll-and-Docker-Compose)
--------------------------------------------------------------------------------
/docs/Testing-docs/Runner-infra-tests.md:
--------------------------------------------------------------------------------
1 | For the actions which takes dependency on hosted runner infra, we were looking at the need of having an automated testing infra where required GH Action test can run on each hosted image update to validate whether new version of hosted runner image is working fine.
2 |
--------------------------------------------------------------------------------
/docs/Testing-docs/Test-workflows-automation.md:
--------------------------------------------------------------------------------
1 | # Automating test workflows in the PR checks.
2 | Test workflows for actions can be automated in the action repo so that whenever a new PR is raised to __master__ or __releases/*__ branches these workflows evaluate on the branch from which PR is raised.
3 |
4 | This process of automated testing enables one to run tests on PRs from a branch in a repo and also PRs from a forked repo. Inorder to ensure the safety of secrets which are used by the pr-check workflows and to prevent pwn requests, the pr-check workflow and secrets should be a part of a [github environment](https://docs.github.com/en/actions/reference/environments) and set appropriate approval policy for triggering this workflow on a new PR.
5 |
6 | So whenever a new PR occurs (especially from a forked repo) , the PR is __manually reviewed__ for security vulneribilities and then approved after which the pr-check workflow is triggered for the new PR. Approvers should manually review for [these](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) before approving the check to run on PR.
7 |
8 | ## Process to automate the workflows:
9 |
10 | 1. Create a ```pr-check.yml``` workflow in **.github/workflows** of the action repo. Setup __Automation test__ environment in the action and enable appropriate approval policy which includes adding reviewers list to approve the PR to run the pr-check. Visit [this](https://docs.github.com/en/actions/reference/environments) to know more about environments.
11 | 2. Put the triggering condition for this workflow as ```on: pull_request_target``` if forked repo PR checks need to be checked automatically otherwise ```on: pull_request``` should do. Visit [pull_request_target](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request_target) for more details.
12 | 3. Steps include:
13 | 1. Checkout the repo.
14 | 2. Setup the Node.js for github action.
15 | 3. Install the **node_modules** using ```npm install``` as the PRs raised to master branch will not have __node_modules__ without which the workflow fails.
16 | 4. Build the action using ```npm run build```( Since some action repos don’t have the updated ```lib/.js``` files as they recommend to exempt ```lib/.js``` in PRs. This step ensures the action to have updated lib files).
17 | 5. Here we are targeting to run a sample test for the action.For multiple scenarios, one can mention different scenarios in the same file and have multiple steps in the WF file calling the necessary actions for the required setup(For example if a .Net app needs to be deployed ,make sure you set up .Net using *actions/setup-dotnet@v1* and resolve those dependencies here).
18 | 6. Run the action with ```uses: ./``` which will pick the current branch of the repo to execute the workflow. Specify the input parameters which are required by the action in the ```with: ``` parameters.
19 |
20 |
21 | ## Sample template:
22 |
23 | ```yml
24 | name: pr-check
25 |
26 | on:
27 | pull_request_target:
28 | branches:
29 | - master
30 | - 'releases/*'
31 |
32 | jobs:
33 | deploy:
34 | environment: Automation test
35 | runs-on: windows-latest
36 | steps:
37 | - name: Checkout from PR branch
38 | uses: actions/checkout@v2
39 | with:
40 | repository: ${{ github.event.pull_request.head.repo.full_name }}
41 | ref: ${{ github.event.pull_request.head.ref }}
42 |
43 | #Using 12.x version as an example
44 | - name: Set Node.js 12.x for GitHub Action
45 | uses: actions/setup-node@v1
46 | with:
47 | node-version: 12.x
48 |
49 | - name: installing node_modules
50 | run: npm install
51 |
52 | - name: Build GitHub Action
53 | run: npm run build
54 |
55 | # include any workflow/action specific dependencies
56 |
57 | - uses: ./ #picks the current action PR code.
58 | with:
59 | #input parameters of the action.
60 |
61 | ```
62 |
--------------------------------------------------------------------------------
/docs/Testing-docs/Testing-GitHub-Actions.md:
--------------------------------------------------------------------------------
1 | # Testing GitHub Actions
2 |
3 | Action development is not complete without robust tests. Tests also help accept contributions from community members, catch issues early and release actions frequently with high confidence. This document describes best practices to test actions, measure code coverage and configure pipelines to run them with every change.
4 |
5 | ## Test Types
6 |
7 | Tests for actions can be categorized into two broad categories.
8 |
9 | **Unit tests** are used to validate the business logic like - string manipulations, for loop, processing platform call responses. Unit tests are not expected to trigger the platform calls like making azure CLI / REST calls. Alternatively, developers can mock such platform calls. These tests can be run as part of build steps without requiring any environment setup. Developers can also use them during the development phase.
10 |
11 | Unit tests should focus on good code coverage. Every checkin should add tests to cover newly added code. Target is to keep code coverage at 80% and it will be made part of the PR approval checklist.
12 |
13 | **Functional tests**** (** also known as end to end tests ) validates end to end functional scenarios. It is important to have a handful of such tests to ensure functionality end to end. A functional test should be designed to cover the real time scenario. Our recommended way to create functional test is to create workflow and execute action with different input, scenario combinations.
14 |
15 | ## Running Tests:
16 |
17 | Once suites of unit tests and function tests are ready, they will be run in different life-cycles of the development process.
18 |
19 | #### During Action Authoring:
20 |
21 | - Running Unit test using VS Code / VS IDE ( Details to be added )
22 | - Running functional test from dev box ( Details to be added )
23 |
24 | #### Pull Request
25 |
26 | During pull request, we want to ensure action logic is tested using unit tests on all platform matrices and there is required code coverage. We have designed the YAML to ensure these coverages. Templates for actions will be set up to run the unit tests for the master and release branches.
27 |
28 | - Yaml file for PR is configured to do the following:
29 | - Run on pull requests in master and release branches.
30 | - This workflow should run on all three OS platforms - windows, ubuntu, macos. One can make use of [matrix strategy](https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix) for the same.
31 | - Workflow should have a build step for syntax validations and followed by a step to run the test.
32 | - It is also recommended to add the test coverage tooling with your infra. The test coverage should provide details for newly added code like - code coverage percentage, file wise code coverage details.
33 |
34 | - Pull request reviewer must check for following:
35 | - Code reviewers should be able to see code coverage data before approving the PR. PR approval must be done only when code coverage is more than 80%. To start with, code coverage should be measured at file level, which is each file has 80% coverage.
36 |
37 | Developer is expected to maintain the test suite copy with each branch to maintain the product code to test code compatibility.
38 |
39 | ## Releasing Action:
40 |
41 | Functional tests are essential to catch bugs in preflight development branches before being released into production.
42 |
43 | Release process consists of below steps:
44 |
45 | - Forking out a branch releases/Vn from the master branch
46 | - Check-in the required dependencies
47 | - Testing
48 | - Tagging the commit with appropriate tag
49 |
50 | On every code push into master and releases branch always run the right set of function tests to validate the code quality. Unless all functional tests are passed, don't proceed for releasing a new version / hotfix.
51 |
52 | Running functional tests automatically on each code push can be achieved by using an action workflow.
53 |
54 | - Set workflow trigger to run on code push for master and all releases branches
55 | - Workflow should contain jobs per branch.
56 | - Each job should test action for different customer scenarios.
57 | - For master branch build the code and test the build action ( As master branch does not contain the supporting modules checked-in)
58 | - Jobs should be executed conditionally depending on the branch where code got pushed.
59 | - **The secrets used in this workflow should be managed using [secret variables](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets).**
60 | - This workflow needs to be updated to cover the newly added features / fixes. Update is nothing but adding the action with appropriate inputs covering newly added changes.
61 | - PR reviewer's check list:
62 | - Secret logging / Updates: PR updating test workflows should be carefully reviewed for any malicious updates on secrets.
63 | - Code coverage: Review the code coverage result posted against PR. It should meet the code coverage bar.
64 |
65 | ## [Open items](https://github.com/github/GitHub-EcoSystem/issues/923)
66 |
67 |
68 | 1. YAML running Unit tests / Functional test got updated in template repo, how we ensure the update is available to other actions repos?
69 | 2. A. Dev box scenario ( Inner dev loop ) - How to run unit tests using VS Code / VS IDE
70 |
71 | To start with scoped down for node JS based actions provide the guidance.
72 |
73 | B. Functional tests what is our recommendation to run these from dev box
74 |
75 |
76 | 3. How to author tests ?
77 |
78 | Focus on this once closed on open item 2.
79 |
80 | 4. Can Actions avoid checking out/forking/syncing test repos?
81 |
82 | We are waiting on platform runner team
83 |
84 | 5. Define the threshold time for unit tests. ( max time taken by single unit test )
85 |
86 | ## Appendix:
87 |
88 | #### Running Unit tests as part pull request: Sample walk through
89 |
90 | - Refer [variable-substitution](https://github.com/microsoft/variable-substitution) action as example. This is a javascript based action. Similar steps can be followed for container and based actions as well.
91 |
92 | - **Setting up unit test framework**
93 |
94 | ***Selecting test framework:***
95 |
96 | - You can select any test framework since the CI workflow resides in the action repo and you can have customized build and test step definitions.
97 | - Here we are using mocha which supports unit tests in typescript.
98 |
99 | ***Installing development dependencies:***
100 |
101 | - Few simple tools to get us started - mocha, chai, ts-node
102 | mocha is a good fit for a testing framework, chai is an assertion library
103 | - To install run below command:
104 | npm install chai mocha ts-node @types/chai @types/mocha --save-dev
105 |
106 | ***Writing your unit tests:***
107 | Find our test files [here](https://github.com/microsoft/variable-substitution/tree/master/src/Tests) .
108 |
109 | ***Running your unit tests:***
110 | Create an npm script that calls mocha with path as a parameter. Instead of letting node run mocha, we're gonna register ts-node to run mocha. [Example](https://github.com/microsoft/variable-substitution/blob/ede5b92701e66ea752d76c4fc7e8888849edfdcd/package.json)
111 |
112 | To execute your tests locally just run:
113 | `npm run test`
114 |
115 | - **Test coverage:**
116 |
117 | So far we understand the basics on unit testing. Let go a step ahead and discuss test coverage. Let's add framework to find the test coverage. This will help us identify if we missed any test case scenario.
118 |
119 | ***Choose test coverage library***
120 | For our scenario, we chose Istanbul as a test coverage library. It will output the code coverage to the command line as well as generating a comprehensive HTML report. One may choose any library suitable to your test framework.
121 |
122 | ***Install dependencies:npm install:*** `npm install --save-dev nyc`
123 |
124 | ***Configuration:*** Write [.nycrc](https://github.com/microsoft/variable-substitution/blob/ede5b92701e66ea752d76c4fc7e8888849edfdcd/.nycrc) file in root directory
125 |
126 | ***Update package.json:*** Add coverage script in [package.json](https://github.com/microsoft/variable-substitution/blob/ede5b92701e66ea752d76c4fc7e8888849edfdcd/package.json)
127 |
128 | ***Execute coverage:***
129 |
130 | Run below command. This will run your tests and generate a report.
131 | `npm run coverage`
132 |
133 | ***Posting code coverage with PR build:***
134 |
135 | With simple [POST call from your workflow](https://github.com/microsoft/variable-substitution/blob/master/.github/workflows/ci.yml#L66), publish the code coverage report against the PR. [[Sample code coverage report.](https://github.com/microsoft/variable-substitution/pull/16#issuecomment-702284009) ]
136 |
137 | #### Running Functional tests on each push: Sample walk through
138 |
139 | - Refer [sample action repo](https://github.com/Azure/sample-action/blob/main/.github/workflows/run-sample-integration-tests.yml) example. This workflow runs on each push to the main and releases branch.
140 | - Jobs are defined to run conditionally on code push to main, releases/v1...branches.
141 | - Each job configured to cover the required customer scenario.
142 | - New version release scenario:
143 | - Test coverage for newly added functionality: While developing the new feature, ensure the main branch functional test job is also updated to cover the new functionality.
144 | - Identify new releases branch name and update the functional test workflow to add the new job to cover the new test cases. This job should run conditionally, on push to new releases branch.
145 | - Push the code to the main branch, if functional tests are passed, create the new releases branch and check-in the dependencies. On dependencies push the functional test workflow will get triggered, monitor the run. Once the functional tests are green, one is ready to tag the new releases branch for new version releases.
146 | - Hot fix scenario:
147 | - Work on code changes in the target releases branch. Update the functional test workflow, to cover the hot fix code changes. E.g. Add the action use case which was failing, and to fix it this hotfix is getting released. This update needs to be made into a job targeting the release branch where the fix is getting pushed.
148 | - On the code push workflow will get executed with an updated functional scenario, and it will catch any regressions or breakages.
149 | - Post confirming the functional test workflow is successful, one is ready to update the releases tag to new hot fix commit.
150 |
151 | NOTE : Refer [automated test process](https://github.com/Azure/actions/blob/main/docs/Testing-docs/Test-workflows-automation.md) to automate the test workflows within action repository as PR checks.
152 |
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | # Welcome to Jekyll!
2 | #
3 | # This config file is meant for settings that affect your whole blog, values
4 | # which you are expected to set up once and rarely edit after that. If you find
5 | # yourself editing this file very often, consider using Jekyll's data files
6 | # feature for the data you need to update frequently.
7 | #
8 | # For technical reasons, this file is *NOT* reloaded automatically when you use
9 | # 'bundle exec jekyll serve'. If you change this file, please restart the server process.
10 | #
11 | # If you need help with YAML syntax, here are some quick references for you:
12 | # https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml
13 | # https://learnxinyminutes.com/docs/yaml/
14 | #
15 | # Site settings
16 | # These are used to personalize your new site. If you look in the HTML files,
17 | # you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
18 | # You can create any custom variable you would like, and they will be accessible
19 | # in the templates via {{ site.myvariable }}.
20 |
21 | title: GitHub Actions for Azure
22 | email: your-email@example.com
23 | description: >- # this means to ignore newlines until "baseurl:"
24 | Create workflows to build, test, package, release and deploy to Azure.
25 | baseurl: "" # the subpath of your site, e.g. /blog
26 | url: "" # the base hostname & protocol for your site, e.g. http://example.com
27 | twitter_username: jekyllrb
28 | github_username: jekyll
29 |
30 | # Build settings
31 | theme: minima
32 | plugins:
33 | - jekyll-feed
34 | sass:
35 | style: compact
36 |
37 | # Exclude from processing.
38 | # The following items will not be processed, by default.
39 | # Any item listed under the `exclude:` key here will be automatically added to
40 | # the internal "default list".
41 | #
42 | # Excluded items can be processed by explicitly listing the directories or
43 | # their entries' file path in the `include:` list.
44 | #
45 | # exclude:
46 | # - .sass-cache/
47 | # - .jekyll-cache/
48 | # - gemfiles/
49 | # - Gemfile
50 | # - Gemfile.lock
51 | # - node_modules/
52 | # - vendor/bundle/
53 | # - vendor/cache/
54 | # - vendor/gems/
55 | # - vendor/ruby/
56 |
--------------------------------------------------------------------------------
/docs/_includes/additional-head.html:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
24 |
--------------------------------------------------------------------------------
/docs/_includes/home-js.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/_layouts/home.html:
--------------------------------------------------------------------------------
1 | ---
2 | title: GitHub Actions for Azure
3 | ---
4 |
5 |
6 |
7 |
8 | {% include head.html %}
9 | {% include additional-head.html %}
10 |
11 |
12 |
13 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
{{site.data.home.hero.h1}}
102 | {% assign num_sections = site.data.home.hero.sections.size %}
103 | {% for block in site.data.home.hero.sections %}
104 |
157 | {% for section in site.data.home.footer.sections %}
158 | {{section.title}}
159 | {% endfor %}
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
171 |
172 |
--------------------------------------------------------------------------------
/docs/action-from-pipeline-task.md:
--------------------------------------------------------------------------------
1 | # Building GitHub Actions from Azure Pipeline Tasks
2 |
3 | ## Introduction
4 |
5 | GitHub Actions and Azure Pipelines share several configuration similarities, which makes migrating to GitHub Actions relatively straightforward.
6 |
7 | [Migrating from Azure Pipelines to GitHub Actions](https://docs.github.com/en/actions/learn-github-actions/migrating-from-azure-pipelines-to-github-actions) highlights the similarities and the key differences between Actions and Azure Pipelines. It describes syntax differences and migration required for Azure pipleines to Actions workflow.
8 |
9 | For more information on GitHub Actions, please see [Core concepts for GitHub Actions.](https://docs.github.com/en/actions/learn-github-actions/introduction-to-github-actions)
10 |
11 | This document describes the basic conversions you need to transform your pipeline tasks code to actions.
12 |
13 | ## Steps to transform Tasks to Actions
14 |
15 | ### 1. Replace Task libraries with Action libraries
16 |
17 | In a pipeline task, the pipeline task lib is used for all the platform functionalities. In Actions, the common functionalities have been broken down into multiple smaller modules like @actions/io @actions/exec @actions/core.
18 |
19 | a. The code logic that is completely independent of the tasks library and any dependencies from the common-npm-packages folder can be re-used as in the Action.
20 |
21 | b. For replacing the Task lib with the Actions libraries, below list contains some example conversions to help you get started.
22 | You might also be internally using certain modules built especially for tasks. When converting to action, please ensure any of your dependencies aren’t bringing in any `vsts-task-lib` references, as that could potentially lead into unexpected problems during runtime.
23 |
24 | | Tasks | Actions | Remarks |
25 | |----------------------|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
26 | | tl.setResourcePath() | | setResourcePath is used to let the tasks lib know where to look for certain localised messages. Actions is entirely hosted, there’s no support |
27 | | tl.loc() | console.log() | Actions are exclusively supported in the hosted environment, removing support for localisation. Put the actual message there and refactor it into a constants block later. |
28 | | tl.getEndpoint() | Take an input, whose expected value is produced using `az sp ad create-for-rbac --sdk-auth` | The concept of serviceConnections doesn’t exist in Actions world. |
29 | | tl.debug() | core.debug() | Import * as core from ‘@actions/core’ |
30 | | tl.getInput() | core.getInput() | Import * as core from ‘@actions/core’, if input is required. Use core.getInput({“required”:true}); |
31 | | tl.getPathInput() | core.getInput() | Given that path input was a UI feature and workflows are exclusively yaml based, you should use core.getInput instead, reading the content as plain text |
32 | | tl.getBoolInput() | core.getInput() Convert to type later | |
33 |
34 |
35 | ### 2. Converting task.json to action.yml
36 |
37 | Please refer to this document for more information on the syntax for authoring Action yml: https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions
38 |
39 | Following are the fields which exist in task.json but not in actions.yml
40 | * ID
41 | * friendlyName
42 | * helpUrl
43 | * helpMarkDown
44 | * Category
45 | * Visibility
46 | * Groups
47 | * Version
48 | * Demands
49 | * Groups
50 | * dataSourceBindings
51 | * instanceNameFormat
52 | * Messages
53 |
54 | You can ignore the above attributes while converting your task.json
55 |
56 | Please find below some examples for conversion -
57 |
58 | | From | To |
59 | |-----|-----|
60 | |“inputs”: [{ "name": "", "type": "", "label": "