This device is not compatible.


Build a Custom GitHub Actions in Rust

In this project, we will build a custom GitHub Actions that can be used to count the number of TODO comments in our source code and display it in the job summary at the end of each workflow run.

Build a Custom GitHub Actions in Rust

You will learn to:

Create a Rust-based GitHub Actions repository with the required descriptor file.

Implement command-line option and environment variable parsing in Rust.

Scan the filesystem to count the number of TODO comments in source files.

Implement interaction with GitHub Actions job output.

Create a Dockerfile for the custom action.

Create a workflow to build and publish the Docker image.


Unit Testing

Docker Images

Task Automation


Basic understanding of Rust

Good understanding of Docker and Dockerfiles

A working and valid GitHub account




GitHub logo


Project Description

GitHub Actions are great for automating builds, software releases, and overall GitHub repository management. They come with a rich ecosystem full of reusable functions for a wide variety of tasks and workflows. For those times when custom functionality is required, GitHub Actions allow us to develop our own and even share it with others in the marketplace. Docker-based actions are appropriate for complex tasks. This approach allows us to use any language to develop our custom action, but, ideally, it would result in a small Docker image that is fast and efficient.

Rust is a typed, memory-safe systems programming language that can be ideal for just this kind of situation. With the right approach, it allows us to build a Docker image that is no larger than a few megabytes, which means short start-up times and resource-efficient execution.

In this project, we will build a custom GitHub Action that can be used to count the number of TODO comments in our source code.

Project Tasks



Task 0: Get Started

Task 1: Set up a Docker Container for GitHub Actions

Task 2: Initialize GitHub Actions Configuration

Task 3: Test the Custom Action with a GitHub Workflow


Basic Functionality

Task 4: Locate Repository Root in GitHub Actions

Task 5: Process Directories Recursively

Task 6: Iterate Over Lines of Text

Task 7: Scan Lines for TODOs

Task 8: Add Unit Tests


Inputs and Outputs

Task 9: Format Log Output

Task 10: Define Input Parameters

Task 11: Parse Command-Line Arguments

Task 12: Generate Step Summary

Task 13: Define Output Parameter

Task 14: Write Output Parameter


Continuous Integration

Task 15: Create a GitHub Repository

Task 16: Customize Release Profile

Task 17: Build and Publish Docker Image

Task 18: Use Published Docker Image