diff --git a/github/create-custom-github-actions/exercise-create-custom-action.yml b/github/create-custom-github-actions/exercise-create-custom-action.yml index 626b9483..290c07af 100644 --- a/github/create-custom-github-actions/exercise-create-custom-action.yml +++ b/github/create-custom-github-actions/exercise-create-custom-action.yml @@ -9,6 +9,6 @@ metadata: ms.date: 04/14/2021 ms.topic: interactive-tutorial ms.prod: learning-azure -durationInMinutes: 6 +durationInMinutes: the page takes about 6 minutes, the exercise is 6 steps long and takes about 1 to 2 hours to be completed content: | - [!include[](includes/exercise-create-custom-action.md)] \ No newline at end of file + [!include[](includes/exercise-create-custom-action.md)] diff --git a/github/create-custom-github-actions/includes/create-custom-github-action.md b/github/create-custom-github-actions/includes/create-custom-github-action.md index 4f43d898..65730582 100644 --- a/github/create-custom-github-actions/includes/create-custom-github-action.md +++ b/github/create-custom-github-actions/includes/create-custom-github-action.md @@ -1,4 +1,4 @@ -GitHub Actions is a powerful feature that empowers you to go from code to cloud all from the comfort and convenience of your own repository. Here, you'll learn about the different types of GitHub actions and the metadata, syntax, and workflow commands to create custom GitHub actions. +Here, you'll learn about the different types of GitHub actions and the metadata, syntax, and workflow commands to create custom GitHub actions. GitHub Actions is a powerful feature that empowers you to go from code to cloud all from the comfort and convenience of your own repository. ## Types of GitHub actions @@ -187,3 +187,4 @@ This text spans%0Aacross multiple lines In addition to workflow commands, you can set exit codes to set the status of an action. This is important because when you're working with jobs in a workflow, a failed exit code will halt all concurrent actions and cancel any future actions. If you are creating a JavaScript action, you can use the actions toolkit `@actions/core` package to log a message and set a failure exit code. If you are creating a Docker container action, you can set a failure exit code in your `entrypoint.sh` script. +Next up, learn about choosing the right visibility for your action, best practices for documenting and versioning your action, and how to publish your action to the GitHub Marketplace. diff --git a/github/create-custom-github-actions/includes/introduction.md b/github/create-custom-github-actions/includes/introduction.md index 30b9ef36..41f4677e 100644 --- a/github/create-custom-github-actions/includes/introduction.md +++ b/github/create-custom-github-actions/includes/introduction.md @@ -1,27 +1,28 @@ -GitHub Actions allow you to create individual, custom actions by writing code that interacts with your repository in any way you'd like, including integrating with GitHub's APIs and any publicly available third-party API. For example, an action can publish npm modules, send SMS alerts when urgent issues are created, or deploy production-ready code. +GitHub Actions allow you to create individual, custom actions by writing code that interacts with your repository in any way you'd like, including integrating with GitHub's APIs and any publicly available third-party API. -You can write your own custom actions to use in your workflow or share the actions you build with the GitHub community. To share actions you've built with the community, your repository must be public. Actions can run directly on compute resources, such as virtual machines, or in Docker containers. You can also define an action's inputs, outputs, and environment variables. +Suppose you are a developer needing your actions to run in a specific environment configuration, need custom solutions for npm modules, or deploying production-ready code. By utilizing GitHub Actions, you can write your own custom actions to use in your workflow or share the actions you build with the GitHub community. GitHub Actions can run directly on computer resources, such as virtual machines, in Docker containers, or by utilizing Node.js. You can go beyond just DevOps when you use GitHub Actions to run workflows when other events happen in your repository. And for example, you can run a workflow to automatically add the appropriate labels whenever someone creates a new issue in your repository. -In this module, you learn the different ways to create a custom action, its necessary metadata and syntax, and how to publish a custom action to the GitHub Marketplace. +In this module, you'll learn the different ways to create a custom action, its necessary metadata and syntax, and how to publish a custom action to the GitHub Marketplace. -## Learning objectives +### Learning objectives -In this module, you will: +In this module, you will learn how to: - Identify the metadata and syntax needed to create custom GitHub actions - Learn best practices to publish a private or public GitHub action -- Consume actions within a workflow file -- Create custom JavaScript based actions - Publish a newly created action to the GitHub Marketplace +- Create custom JavaScript based actions -## Prerequisites +### Prerequisites This module assumes you have basic familiarity with GitHub Actions and workflows. - A GitHub account - The ability to navigate and edit files in GitHub - - For more information about GitHub, see [Introduction to GitHub](https://lab.github.com/githubtraining/introduction-to-github?azure-portal=true). + - For more information about GitHub, see [Introduction to GitHub](https://learn.microsoft.com/en-us/training/modules/introduction-to-github/). - Basic familiarity with GitHub Actions and workflows - - If you aren't familiar with workflows, jobs and steps, check out the [Automate development tasks by using GitHub Actions](/learn/modules/github-actions-automate-tasks/) module. + - If you aren't familiar with workflows, jobs and steps, check out the [Automate development tasks by using GitHub Actions](https://learn.microsoft.com/en-us/training/modules/github-actions-automate-tasks/) module. - Basic familiarity with continuous integration using GitHub Actions and workflows - - If you're unfamiliar with continuous integration using GitHub Actions and workflows, check out [Build continuous integration workflows by using GitHub Actions](/learn/modules/github-actions-ci/) \ No newline at end of file + - If you're unfamiliar with continuous integration using GitHub Actions and workflows, check out [Build continuous integration workflows by using GitHub Actions](https://learn.microsoft.com/en-us/training/modules/github-actions-ci/) + +Up next, learn about the metadata, syntax, and workflow commands to create custom GitHub Actions. diff --git a/github/create-custom-github-actions/includes/publish-custom-github-action.md b/github/create-custom-github-actions/includes/publish-custom-github-action.md index b77d1f6e..da1fbef2 100644 --- a/github/create-custom-github-actions/includes/publish-custom-github-action.md +++ b/github/create-custom-github-actions/includes/publish-custom-github-action.md @@ -85,4 +85,6 @@ Below are the requirements to publish an action to the GitHub Marketplace. They - The `name` cannot match an existing GitHub Marketplace category. - The `name` cannot match an existing GitHub feature. -You can add the action you've created to the GitHub Marketplace by tagging it as a new release and then publishing it. There are a few guided steps in GitHub that enable you to publish a release of your action. More information on these steps can be found in the summary section at the end of this module. +You can add the action you've created to the GitHub Marketplace by tagging it as a new release and then publishing it. There are a few guided steps in GitHub that enable you to publish a release of your action. + +Next up, an exercise walking you through writing your own GitHub JavaScript Action and automate customized tasks unique to your workflow. diff --git a/github/create-custom-github-actions/index.yml b/github/create-custom-github-actions/index.yml index c81ef5c2..255b6c0d 100644 --- a/github/create-custom-github-actions/index.yml +++ b/github/create-custom-github-actions/index.yml @@ -3,7 +3,7 @@ uid: learn.github.create-custom-github-actions metadata: title: Create and publish custom GitHub actions description: Learn how to create and publish custom GitHub actions. - ms.date: 08/08/2022 + ms.date: 09/28/2022 author: a-a-ron ms.author: aastewar ms.topic: interactive-tutorial @@ -14,9 +14,8 @@ abstract: | In this module, you will learn how to: - Identify the metadata and syntax needed to create custom GitHub actions - Learn best practices to publish a private or public GitHub action - - Consume actions within a workflow file - - Create custom JavaScript based actions - Publish a newly created action to the GitHub Marketplace + - Create custom JavaScript based actions levels: - intermediate roles: @@ -29,10 +28,13 @@ products: prerequisites: | - A GitHub account - The ability to navigate and edit files in GitHub + - For more information about GitHub, see [Introduction to GitHub](https://lab.github.com/githubtraining/introduction-to-github?azure-portal=true). - Basic familiarity with GitHub Actions and workflows + - If you aren't familiar with workflows, jobs and steps, check out the [Automate development tasks by using GitHub Actions](/learn/modules/github-actions-automate-tasks/) module. - Basic familiarity with continuous integration using GitHub Actions and workflows subjects: -- devops + - If you're unfamiliar with continuous integration using GitHub Actions and workflows, check out [Build continuous integration workflows by using GitHub Actions](/learn/modules/github-actions-ci/) + - devops units: - learn.github.create-custom-github-actions.introduction - learn.github.create-custom-github-actions.create-custom-github-action diff --git a/github/create-custom-github-actions/knowledge-check.yml b/github/create-custom-github-actions/knowledge-check.yml index eecb2860..c4d3c448 100644 --- a/github/create-custom-github-actions/knowledge-check.yml +++ b/github/create-custom-github-actions/knowledge-check.yml @@ -15,20 +15,20 @@ content: | quiz: title: Check your knowledge questions: - - content: "You need to create a custom GitHub Action written in Ruby. Which action type would you choose?" + - content: "You want your action to run in a consistent and reliable environment. Which action type would you choose?" choices: - content: "JavaScript action" isCorrect: false - explanation: "Although you can write actions in JavaScript, Docker container actions are used for other languages." + explanation: "JavaScript actions separate the action code from the environment that is used to run the action." - content: "Run step" isCorrect: false - explanation: "Run steps execute terminal commands within a runner." + explanation: "Composite run steps actions allow you to mix multiple shell languages within the same action, not create consistent and reliable environments." - content: "Docker container action" isCorrect: true - explanation: "Actions written in a language other than JavaScript must be placed inside of a Docker container." + explanation: "Docker containers package the environment with the GitHub Actions code, meaning the action runs in a consistent and reliable environment." - content: "Bash script" isCorrect: false - explanation: "Bash scripts would either need to be run in Docker or as a parameter to a Run step." + explanation: "Bash scripts are a parameter to a Run step, not how your actions run in a consistent and reliable environment." - content: "Which keywords are required for a valid `action.yml` file?" choices: - content: "name, runs, composite" @@ -54,6 +54,6 @@ quiz: - content: echo "::error::message=This is an error message" isCorrect: false explanation: "This is improper syntax for a workflow command." - - content: echo "::error::This is an error message::" + - content: echo "::errorThis is an error message::" isCorrect: false - explanation: "This is improper syntax for a workflow command." \ No newline at end of file + explanation: "This is improper syntax for a workflow command."