• Stars
    star
    261
  • Rank 156,630 (Top 4 %)
  • Language
    Dockerfile
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Curated list of useful Github actions with workflows examples πŸ’‘

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 Accept Collabs

Auto Accept Collabs: Github Action to accept automatically all collaboration invites. Useful for a bot account.

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.

Changed Files

Changed Files: Github Action to retrieve all changed files relative to the default branch (pull_request* based events) or the last remote commit (push based event) returning the absolute path to all changed files from the project root.

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.

Copycat

Copycat: GitHub action to copy files from your repository to another external repository. It is also possible to copy files from/to repository Wikis.

Create JSON

Create JSON: GitHub Action to create a .json file dynamically on your workflow.

Create Pull Request

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

Curl

Curl: GitHub action to use the curl CLI to perform http requests.

Debug

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

Delete Artifacts

Delete Artifacts: GitHub Action to delete artifacts within a workflow run. This can be useful when artifacts are shared across jobs, but are no longer needed when the workflow is complete.

Enforce PR labels

Enforce PR labels: GitHub action to enforce assigning labels before merging PR's. Useful for generating automatic changelog and release notes with github-release-notes.

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.

GHAction Dump Context

GHAction Dump Context: GitHub Action to dump context of your workflow (which allows to check all variables available using the github.event syntax in the workflow).

GHAction Github Status

GHAction Github Status: GitHub Action to check GitHub Status in workflows, allowinf to trigger error if GitHub services are down.

Git Auto Commit

Git Auto Commit: GitHub Action to detect changed files during a Workflow run and to commit and push them back to the GitHub repository. By default, the commit is made in the name of "GitHub Actions" and co-authored by the user that made the last commit.

Github Environment Variables

Github Environment Variables: GitHub Action to expose useful environment variables.

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.

Manual Approval

Manual Approval: Github Action to pause a workflow and require manual approval from one or more approvers before continuing.

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.

Read File

Read File: Github Action to read file contents.

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.

Replace Token

Replace Token: GitHub Action for replacing tokens in files.

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.

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.

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).

Wait on check

Wait on check: Github Action to pause a workflow until a job in another workflow completes successfully.

Workflow Dispatch Workflow Dispatch Triggered

Workflow Dispatch: Github Action to trigger another GitHub Actions workflow, using the workflow_dispatch event. The workflow must be configured for this event type e.g. on: [workflow_dispatch]. This allows you to chain workflows, the classic use case is have a CI build workflow, trigger a CD release/deploy workflow when it completes. Allowing you to maintain separate workflows for CI and CD, and pass data between them as required.


🐳 Docker Actions

GHAction Container Scan

GHAction Container Scan: GitHub Action to check for vulnerabilities in a container image with Trivy.

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 debug workflows

The action-upterm uses upterm and tmux to offer a direct way to interact with the host system on which the actual actions will run.

By using this minimal example a upterm session will be created.

name: CI
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Setup upterm session
      uses: lhotari/action-upterm@v1

To get the ssh connection string, just open the workflow Checks tab and scroll to the bottom.

Note: If you want to continue a workflow and you are inside a upterm session, just create a empty file with the name continue either in the root directory or in the workspace directory by running touch continue or sudo touch /continue. Closing the terminal will also continue the workflow. However you won't be able to reconnect in that case. It's possible to detach from the terminal and not continue by first pressing C-b and then d (tmux detach command keys).


πŸ€– 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)

More Repositories

1

poc-github-actions

Various proofs of concept examples using Github Actions πŸ€–
Python
295
star
2

java-training-api

Esse repositΓ³rio disponibiliza uma versΓ£o zero de uma API de cadastro de usuΓ‘rios (Users) a ser melhorada com desafios β˜•οΈ πŸ‡§πŸ‡·
Java
103
star
3

developers-tips-and-tricks-resources

Repository with various tips and tricks for developers πŸ§‘β€πŸ’»πŸ’‘
65
star
4

clone-github-repo-action

Github Action to clone a public or private Github repository and access its content on others repositories' workflows ♻️
47
star
5

GuillaumeFalourd

🟩⬜️ Fork this repository to customize your profile! πŸ§‘β€πŸ’»β­
44
star
6

formulas-github

Ritchie CLI formulas interacting with Github APIs :octocat:
Python
35
star
7

java-exercices

ExercΓ­cios em Java para iniciantes (prΓ©-Junior) β˜•οΈπŸ‡§πŸ‡·
Java
34
star
8

setup-windows10-sdk-action

Github action to download and install a specific version of the Windows 10 SDK πŸ“¦
JavaScript
27
star
9

assert-command-line-output

Github Action to assert / check a command line output πŸ•΅οΈβš™οΈπŸ–₯
18
star
10

formulas-python

Ritchie CLI formulas in Python 🐍
Python
18
star
11

git-commit-push

GitHub Action to commit & push changes made in workflows :octocat:
14
star
12

java-trilha-basica

Trilha de introdução ao uso de Java no Back-End πŸ“šβ˜•οΈπŸ‡§πŸ‡·
13
star
13

formulas-aws

Ritchie CLI formulas to create a Kubernetes Cluster on AWS through one command line πŸ€– πŸ› 
Go
12
star
14

create-other-repo-branch-action

Github Action to create a new branch on another repository πŸ†•πŸš€
11
star
15

setup-rsync

Github Actions to setup rsync (all os supported) πŸ”„
10
star
16

formulas-games

Ritchie CLI formulas with games πŸ‘Ύ
Python
10
star
17

docker-mysql-python

POC usando Docker com MySQL e Python (FastAPI) πŸ‡§πŸ‡·
Python
9
star
18

poc-encryption-jwt

POC using pyjwt to encrypt / decrypt JWT 🐍 πŸ”
Python
8
star
19

formulas-insights

Ritchie CLI formulas to get insights from various tools such as Github, GoogleDocs, LinkedIn or other social networks πŸ•΅οΈβ€β™‚οΈ
Python
8
star
20

stackspot-ai-rqc

StackSpot AI Remote Quick Command Action
Python
7
star
21

sign-and-notarize-gha

Repository explaining step by step how to sign and notarize packages with Apple using Github Actions 🍎 :octocat:
7
star
22

repositories-reports

You can fork this project to get weekly insights reports for your personal repositories ⏱ πŸ“‹ :octocat:
5
star
23

ritchie-formulas-scheduler-demo

Repository with a Github Action workflow example to execute specific Ritchie CLI formulas using CRON ⏰
5
star
24

poc-bank-api-java

POC of a bank api in JAVA β˜•οΈ
Java
4
star
25

aws-clis-action

Github Action to use ANY version (1.x.y or 2.x.y) of AWS CLI to run ANY AWS CLI commands on your workflows πŸ€–
Shell
4
star
26

stackspot-ai-security-action-poc

StackSpot AI Security Action POC
Python
3
star
27

pull-request-action

Github Actions to create pull request (all os supported) using Github CLI ‡️
3
star
28

formulas-gRPC

Ritchie CLI formulas interacting with API using gRPC
Java
3
star
29

wait-sleep-action

Github actions to wait / sleep during a workflow execution ⏱
3
star
30

write-java-properties-file

GitHub Action to write keys=values to a java properties file β˜•οΈ :octocat:
Shell
3
star
31

formulas-4-tests

This repository contains Ritchie CLI formulas I'm testing πŸ’£
Makefile
2
star
32

poc-grpc-java-gradle

POC of a gRPC project in Java using Gradle β˜•οΈ
Java
2
star
33

command-output-file-action

Github Action to generate an output file from a command execution (success or error) πŸ“
2
star
34

diff-action

Github Action to compare 2 files using diff πŸ•΅οΈ
2
star
35

ritchie-demo-create-cluster

Terraform project created with Ritchie CLI to provide a Kubernetes Cluster.
HCL
2
star
36

open-issue-action

Github Action to open a new issue on ANY Github repository that the Personal Access Token (PAT) has access to πŸ€–
Dockerfile
2
star
37

copy-push-files

GitHub Action to copy & push contents (files / directory) from a repository to another :octocat:
2
star
38

ritchie-cli-action

Github Action to run Ritchie CLI commands on any OS runner βš™οΈπŸ–₯
2
star
39

convert-json-to-env

Github Actions to convert variables from a JSON file to workflow ENV variables :octocat:
Python
1
star
40

formulas-pontomais

Ritchie CLI formulas interacting with Pontomais API πŸ€– πŸ› 
Go
1
star
41

SSH-to-HTTPS

Github Action to configure git to use HTTPS authentication instead of SSH
1
star
42

poc-chalice-python

POC of a Cloud Hosted API Server using Chalice and AWS Lambda in Python 🐍
Python
1
star
43

formulas-v3

Formulas to test Ritchie CLI v3 features and OS CLI core commands.
Python
1
star
44

poc-grpc-java-maven

POC of a gRPC project in Java using Maven β˜•οΈ
Java
1
star
45

stackspot-plugins

Repository with StackSpot plugins
HCL
1
star
46

poc-subprocess

POC using subprocess lib in Python 🐍
Python
1
star
47

poc-cli-golang

POC of a CLI project using Golang 🐿 with Cobra.
Go
1
star
48

poc-proto

This repository contains diversous protobuf files to use with gRPC services implementations.
1
star
49

notary-tools

Github Action to notarize and staple Apple products :octocat:
1
star
50

ritchie-docker-images

Docker images to run ritchie cli formulas
Dockerfile
1
star
51

formulas-office-hours

Ritchie CLI formulas from the 10/03/2021 Zup Office Hours 🏒 ⏱
Makefile
1
star
52

poc-cli-translations

POC using Click and python-i18n to test how to implement translations on a CLI tool.
Python
1
star
53

ritchie-tdc-poa

Terraform project created with Ritchie CLI to provide a Kubernetes Cluster. The demonstration happened during The Developer Conference Porto Alegre on 12.04.2020
1
star
54

stackspot-actions

Repository with StackSpot actions
Python
1
star
55

ritchie-action-java-8

Ritchie CLI github action for JAVA 8 πŸ€–
Shell
1
star
56

branch-exists

GitHub Action to check if a branch exists in the current repo :octocat:
1
star
57

ritchie-action-python

Ritchie CLI github action for PYTHON πŸ€–
Shell
1
star
58

ritchie-tdc-recife

Terraform project created with Ritchie CLI to provide a Kubernetes Cluster. The demonstration happened during The Developer Conference Recife on 10.28.2020
1
star
59

github-team-members

Github Actions to get / check Github Team Members :octocat:
1
star