Skip to content
main
Switch branches/tags
Code

useful-actions

title

This repository lists some useful generic Actions to use in your Github workflows and repositories.

Summary


πŸ’‘ Good To Know


πŸ”Ž Useful Actions


οΏ½? Global Actions

Action Cond

Action Cond: GitHub Action to use a if-else operation when needed, to set dynamic configuration of other steps.

Add Label

Add Label: GitHub Action to add GitHub labels to an issue or a pull request.

Add Reviewers

Add Reviewers: Github action that adds Reviewers to the Pull Request.

App Token

App Token: Github Action to impersonate a GitHub App when secrets.GITHUB_TOKEN's limitations are too restrictive and a personal access token is not suitable.

Assert command line output

Assert command line output: Github Action to assert / check a command line output.

Auto approve

Auto Approve: Github Action to automatically approve pull requests.

Auto Assign

Auto Assign: Github Action to add reviewers and assignees to a pull request when opened (needs auto_assign.yml configuration file).

Auto Assign Author

Auto Assign Author: Github Action to automatically assigns PR author as an assignee.

Auto merge

Auto Merge: GitHub action to automatically merge pull requests when they are ready (automerged label).

Branch Names

Branch Names: Github Action to get branch or tag information without the /ref/* prefix.

Cache

Cache: Github Action to cache dependencies and build outputs to improve workflow execution time.

Cancel Workflow

Cancel Workflow: Github Action cancel any previous runs that are not completed for a given workflow. This includes runs with a status of queued or in_progress.

Checkout

Checkout: Github Action to checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.

Close Pull Request

Close Pull Request: Github Action to automatically close a pull request (for example if modifying untouchable files).

Commit And Push

Commit And Push: Github Action to commit and push new code to the repository.

Compress Images

Compress Images: Github Action to automatically compresses JPEGs, PNGs and WebPs in Pull Requests.

Create Pull Request

Create Pull Request: GitHub action to create a pull request for changes to your repository in the actions workspace.

Debug

Debug: GitHub action to print the environment variables and the event payload. Useful for developing or debugging GitHub Actions.

Env Vars

Env Vars: GitHub action to expose useful environment variables.

File Existence

File Existence: Github Action to check if files exists or not.

First Interaction

First Interaction: Github Action to filter pull requests and issues from first-time contributors.

Get Workflow Origin Get Workflow Origin Information

Get Workflow Origin: Github Action to provide information about the pull requests that triggered the workflow for the pull_request and pull_request_review events or for the workflow_run event that is triggered by one of those events.

Github Script

Github Script: Github Action to make it easy to quickly write a script in your workflow that uses the GitHub API and the workflow run context.

Gitleaks

Gitleaks: Github Action to detect hardcoded secrets like passwords, api keys, and tokens in git repos.

Horusec

Horusec: Github Action to identify vulnerabilities in your project.

Paths Filter

Paths Filter: Github Action that enables conditional execution of workflow steps and jobs, based on the files modified by pull request, on a feature branch, or by the recently pushed commits.

Pull Request

Pull Request: GitHub Action to create pull requests automatically.

Purge Artifacts

Purge Artifacts: Github Action responsible for deleting old artifacts by setting expire duration.

Set Secrets

Set Secrets: Github Action to Create or edit actions secrets in repository or organizations.

Example

Skip duplicate

Skip duplicate: GitHub Action to skip duplicate workflow-runs (after merges, pull requests or similar), skip concurrent or parallel workflow-runs for things that you do not want to run twice, skip ignored paths to speedup documentation-changes or similar, skip if paths not changed for something like directory-specific tests, cancel outdated workflow-runs after branch-pushes.

Stale

Stale: GitHub Action to warn and then close issues and PRs that have had no activity for a specified amount of time.

Recreate Release

Recreate Release: Github Action to delete previous release by tag_name or release_name and then call actions/create-release to create it again.

Release

Release: GitHub Action for creating GitHub Releases on Linux, Windows, and macOS virtual environments.

Repository-Dispatch Repository-Dispatch-Triggered

Repository-Dispatch: GitHub Action to create a repository dispatch event.

Retry Action

Retry Action: GitHub Action to rerun another GitHub Actions and commands.

Super Linter

Super Linter: Github Action to help validate your source code.

Upload & Download Artifacts

Upload Artifact: Github Action to share data between jobs and store data once a workflow is complete (example).

Download Artifact: Github Action to download artifacts from your build (example).


οΏ½?οΏ½ Docker Actions

Hadolint

Hadolint: Github Action to run Hadolint and reports violations given a Dockerfile within a repository on a pull request.

Phonito

Phonito: Github Action to automate scanning Docker images for OS & library vulnerabilities. Need a free Phonito Security account at https://phonito.io.

Publish Docker

Publish Docker: Github Action to build and push containers.


οΏ½? How to create new actions

The Github tutorial is great to understand how to create:


πŸ€– How to test actions locally

This tool can be used to test actions locally: Act

Screenshot


οΏ½? Contribution

Would like to contribute to the repository? Here are the guidelines πŸš€

(Made with contributors-img)