6 GitHub Actions Every DevOps Team Needs

In this post, we’ve highlighted a few must-have GitHub Actions that can simplify our CI/CD processes, improve team collaboration, and take care of routine tasks automatically. Whether it’s compressing images, managing dependencies, or even automating v…


This content originally appeared on DEV Community and was authored by CiCube

In this post, we’ve highlighted a few must-have GitHub Actions that can simplify our CI/CD processes, improve team collaboration, and take care of routine tasks automatically. Whether it's compressing images, managing dependencies, or even automating version control, these actions are designed to make our work more efficient and organized.

1. calibreapp/image-actions: Compress Images Automatically in Your Project

calibreapp/image-actions

This calibreapp/image-Actions GitHub Action, automatically compresses images (JPEG, PNG, and WebP) when a pull request is made. It uses advanced algorithms like mozjpeg and libvips to compress images without sacrificing quality.

This action is customizable, runs on-demand or can be scheduled, and works well even in larger teams using GitHub Enterprise.

- name: Checkout Repo
  uses: actions/checkout@v4

- name: Compress Images
  uses: calibreapp/image-actions@main
  with:
    githubToken: ${{ secrets.GITHUB_TOKEN }}

Why we need it:

  • Automatically compresses images for better performance without losing quality.
  • It can be tailored to your project’s specific needs but comes with sensible defaults.

2. crate-ci/typos: A Spell Checker for Your Codebase

crate-ci/Typos: A Spell Checker for Your Codebase

The crate-ci/typos GitHub Action helps eliminate spelling mistakes in your codebase or documentation by automatically detecting and fixing them. It is especially useful in larger projects where reviewing every file manually is time-consuming.

- name: Checkout Actions Repository
  uses: actions/checkout@v4

- name: Check spelling of file.txt
  uses: crate-ci/typos@master
  with:
  files: ./file.txt

- name: Use custom config file
  uses: crate-ci/typos@master
  with:
  files: ./file.txt
  config: ./myconfig.toml

- name: Ignore implicit configuration file
  uses: crate-ci/typos@master
  with:
  files: ./file.txt
  isolated: true

- name: Writes changes in the local checkout
  uses: crate-ci/typos@master
  with:
  write_changes: true

Why we need it:

  • Automatically fixes typos, reducing manual error-checking during code reviews.
  • Optimized for large projects with minimal false positives.

3. actions/first-interaction: Immediately engage new contributors or team members automatically.

In particular, the first-interaction GitHub Action is great if you want to send a custom message to first-time developers—be they new hires at your company or contributors to open source projects.

That’s a pretty simple and neat way to welcome new contributors to your project, and you can even offer your project SWAG kit to make this experience even more memorable.

- uses: actions/first-interaction@v1
  with:
    repo-token: ${{ secrets.GITHUB_TOKEN }}
    issue-message: 'Message that will be displayed on users first issue'
    pr-message: 'Message that will be displayed on users first pr'

4. Changesets: Automate Versioning and Changelogs

This changesets/action GitHub Action automates versioning and changelog generation by opening a pull request whenever there are changes to the main branch. The PR updates automatically with the latest changes, and once merged, it can publish the package or handle version updates.

- name: Create Release Pull Request
  uses: changesets/action@v1
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Why we need it:

  • Automates the process of managing version updates and changelogs, ensuring they’re always up to date.
  • Simplifies the release process, reducing manual effort and potential errors.

5. actions/labeler: Automatically label issues and pull requests

This actions/labeler GitHub action automatically labels pull requests or issues based on the changes made or the branch name. It’s particularly helpful in large projects where PRs need to be categorized quickly without manual intervention.

The action automates the labeling of PRs based on modified files or branch names. This is quite useful in large projects when PRs need preliminary categorization without human intervention.

.github/labeler.yml

# Add 'Documentation' label to any changes within 'docs' folder or any subfolders
Documentation:
- changed-files:
  - any-glob-to-any-file: 'docs/*'

# Add 'feature' label to any PR targeting a branch that starts with 'feature'
feature:
 - head-branch: ['^feature', 'feature']

# Label PRs that target the main branch with the 'release' label
release:
 - base-branch: 'main'

Usage

name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
  labeler:
    permissions:
      contents: read
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
    - uses: actions/labeler@v5

Why we need it:

  • Automatically categorizes PRs or issues, saving time on manual labeling.
  • Helps keep large projects organized by automatically tagging based on file changes or branch names.

6. actions/cache: Speed Up Workflows by Caching Dependencies

This actions/cache GitHub Action speeds up workflows by caching dependencies or build files. When files are frequently downloaded during builds, the action restores them from the cache, reducing download time and network usage.

It’s particularly useful for package managers like npm, Yarn, or Maven in continuous integration pipelines.

- name: Cache node modules
  uses: actions/cache@v3
  with:
    path: ~/.npm
    key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
    restore-keys: |
      ${{ runner.os }}-build-

Why we need it:

  • Caches dependencies and build files, reducing workflow runtime and network usage.
  • Perfect for accelerating CI processes with tools like npm, Yarn, or Maven.

Summary

These GitHub Actions definitely help in automating routine tasks, and maintaining our CI/CD pipelines. Be it compressing images, catching typos, automating versioning, or labeling PRs—all these actions reduce manual work for day-to-day tasks.

They speed up our workflows, adding more accuracy to drawing better performance of projects with minimal errors and easy collaboration across the team.

Monitoring GitHub Actions Workflows

CICube is a GitHub Actions monitoring tool that provides you with detailed insights into your workflows to further optimize your CI/CD pipeline. With CICube, you will be able to track your workflow runs, understand where the bottlenecks are, and tease out the best from your build times. Go to cicube.io now and create a free account to better optimize your GitHub Actions workflows!

CICube GitHub Actions Workflow Duration Monitoring


This content originally appeared on DEV Community and was authored by CiCube


Print Share Comment Cite Upload Translate Updates
APA

CiCube | Sciencx (2024-10-01T23:06:30+00:00) 6 GitHub Actions Every DevOps Team Needs. Retrieved from https://www.scien.cx/2024/10/01/6-github-actions-every-devops-team-needs/

MLA
" » 6 GitHub Actions Every DevOps Team Needs." CiCube | Sciencx - Tuesday October 1, 2024, https://www.scien.cx/2024/10/01/6-github-actions-every-devops-team-needs/
HARVARD
CiCube | Sciencx Tuesday October 1, 2024 » 6 GitHub Actions Every DevOps Team Needs., viewed ,<https://www.scien.cx/2024/10/01/6-github-actions-every-devops-team-needs/>
VANCOUVER
CiCube | Sciencx - » 6 GitHub Actions Every DevOps Team Needs. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/01/6-github-actions-every-devops-team-needs/
CHICAGO
" » 6 GitHub Actions Every DevOps Team Needs." CiCube | Sciencx - Accessed . https://www.scien.cx/2024/10/01/6-github-actions-every-devops-team-needs/
IEEE
" » 6 GitHub Actions Every DevOps Team Needs." CiCube | Sciencx [Online]. Available: https://www.scien.cx/2024/10/01/6-github-actions-every-devops-team-needs/. [Accessed: ]
rf:citation
» 6 GitHub Actions Every DevOps Team Needs | CiCube | Sciencx | https://www.scien.cx/2024/10/01/6-github-actions-every-devops-team-needs/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.