GithubHelp home page GithubHelp logo

wayofdev / gh-actions Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 346 KB

Shared github action workflows for usage in Wayofdev projects.

Home Page: https://wayof.dev

License: MIT License

Makefile 57.30% Shell 42.70%
actions github-actions wayofdev wod

gh-actions's Introduction




Build Status Software License Commits since latest release Conventional Commits Codecov Follow on Twitter (X)

Shared GitHub Actions

This repository is a collection of reusable workflows and composite actions, specifically designed for use in wayofdev projects.

These tools encapsulate common and repetitive tasks, allowing for easy integration into multiple projects. This approach not only reduces the need to rewrite code but also ensures standardized operations across all Wayofdev repositories.


๐Ÿ“‹ Table of Contents


๐Ÿš€ Getting Started

To use these workflows and actions, reference them directly from your project's workflows. Detailed instructions for each are provided below.


โš™๏ธ Composite Actions

Composite Actions are a powerful feature of GitHub Actions that allow you to create reusable actions using a combination of other actions, shell commands, or both.

This enables you to encapsulate a sequence of steps into a single action, making your workflows more modular, easier to maintain, and reducing duplication across your projects.

Composite Actions can accept inputs and use outputs, making them highly flexible and adaptable to various use cases.

Check each action's README file for detailed instructions on how to use it.

Action Description
composer/get-cache-directory Gets the Composer cache directory path and exports it as env variable.
composer/get-root-version determines the Composer root version based on the specified branch and exports it as env variable.
composer/install Installs dependencies with Composer based on the specified dependency level.
phive/install Install dependencies with Phive.
playwright/install Installs Playwright along with its dependencies.
pnpm/install Installs mono-repository dependencies using PNPM.
s3/cache Cache artifacts, or restore them using S3.

โš™๏ธ Workflows

Read more about reusing workflows.

โ†’ Auto Label and Release Management

apply-labels.yml:

Automatically applies labels to pull requests based on modified paths.

This workflow triages pull requests and applies labels based on the paths that are modified in the pull request. This can help to categorize your pull requests and make it easier to identify the type of changes included.

To use this workflow, set up a .github/labeler.yml file with your configuration in your project. For more information on how to configure the labeler, see: https://github.com/actions/labeler/blob/master/README.md

Here is an example of how to use this workflow:

.github/workflows/apply-labels.yml
---

on:
  pull_request:

name: ๐Ÿท๏ธ Add labels

jobs:
  label:
    uses: wayofdev/gh-actions/.github/workflows/apply-labels.yml@master
    with:
      os: ubuntu-latest
    secrets:
      token: ${{ secrets.GITHUB_TOKEN }}

...
.github/labeler.yml
---

"type: bug":
    - head-branch: ['^bug', '^fix', 'bug', 'fix']

"type: enhancement":
    - head-branch: ['^feature', '^feat', 'feature']

"type: documentation":
    - changed-files:
          - any-glob-to-any-file: ['assets/**/*', '.github/*', './*.md']

"type: maintenance":
    - changed-files:
          - any-glob-to-any-file: ['tests/**/*', '.github/workflows/*']

...

Real-world examples can be found in the wayofdev/laravel-package-tpl repository.


auto-merge-release.yml:

This workflow automatically merges releases. This workflow utilizes peter-evans/enable-pull-request-automerge to auto-merge releases that are created by googleapis/release-please.

Here is an example of how to use this workflow:

.github/workflows/auto-merge-release.yml
---

on:  # yamllint disable-line rule:truthy
  pull_request:

permissions:
  pull-requests: write
  contents: write

name: ๐Ÿคž Auto merge release

jobs:
  auto-merge:
    uses: wayofdev/gh-actions/.github/workflows/auto-merge-release.yml@master
    with:
      os: ubuntu-latest
      pull-request-number: ${{ github.event.pull_request.number }}
      actor: lotyp
      merge-method: merge
    secrets:
      # to trigger other workflows, pass PAT token instead of GITHUB_TOKEN
      token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}

...

Real-world examples can be found in the wayofdev/laravel-package-tpl repository.


create-changesets-release.yml:

This workflow creates a release based on changesets. This workflow utilizes changesets/action to create a release based on changesets.

Here is an example of how to use this workflow:

.github/workflows/create-changesets-release.yml
---
on: # yamllint disable-line rule:truthy
    push:
        branches:
            - master

name: ๐Ÿฆ‹ Create release or publish to pnpm

jobs:
    release:
        uses: wayofdev/gh-actions/.github/workflows/create-changesets-release.yml@master
        with:
            node: 18
            repository: wayofdev/next-starter-tpl
        secrets:
            # to trigger other workflows, pass PAT token instead of GITHUB_TOKEN
            token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
            npm_token: ${{ secrets.NPM_TOKEN }}

...

Real-world examples can be found in the wayofdev/next-starter-tpl repository.


โ†’ Docker Workflows

build-image.yml:

This workflow builds a docker image and pushes it to the Docker Container Registry.

Example repositories, using this workflow:

Build image with "release" tag:

.github/workflows/build-release.yml
---

on:  # yamllint disable-line rule:truthy
  release:
    types:
      - released

name: ๐Ÿš€ Build docker images with release tag

jobs:
  prepare:
    runs-on: "ubuntu-latest"
    outputs:
      matrix: ${{ steps.matrix.outputs.matrix }}
      version: ${{ steps.version.outputs.version }}
    steps:
      - name: โš™๏ธ Generate matrix
        id: matrix
        run: |
          echo 'matrix={
            "os_name": ["alpine"],
            "php_version": ["8.1", "8.2"],
            "php_type": ["fpm", "cli", "supervisord"]
          }' | tr -d '\n' >> $GITHUB_OUTPUT

      - name: โš™๏ธ Get version for image tag
        id: version
        run: |
          version=${{ github.ref_name }}
          version=${version#v}
          echo "version=$version" >> $GITHUB_OUTPUT

  build:
    needs: prepare
    strategy:
      matrix: ${{ fromJson(needs.prepare.outputs.matrix )}}
    uses: wayofdev/gh-actions/.github/workflows/build-image.yml@master
    with:
      os: "ubuntu-latest"
      push-to-hub: true
      image-namespace: "wayofdev/php-base"
      image-template-path: "./dist/base"
      image-template: ${{ matrix.php_version }}-${{ matrix.php_type }}-${{ matrix.os_name }}
      image-version: ${{ needs.prepare.outputs.version }}
    secrets:
      docker-username: ${{ secrets.DOCKER_USERNAME }}
      docker-password: ${{ secrets.DOCKER_TOKEN }}

...

Real-world examples can be found in the wayofdev/docker-node repository.


โ†’ Code Architecture

create-arch-diagram.yml:

This workflow leverages the codesee-io/codesee-action action to automatically generate architecture diagrams for your codebase whenever a pull request is made.

CodeSee is an open-source tool that helps visualize your codebase and its dependencies, making it easier for new contributors to understand the project or for maintaining a clear view of your project's architecture over time.

Here is an example of how to use this workflow:

.github/workflows/create-arch-diagram.yml
---

on:  # yamllint disable-line rule:truthy
  push:
    branches:
      - develop
  pull_request_target:
    types:
      - opened
      - synchronize
      - reopened

name: ๐Ÿค– CodeSee

permissions: read-all

jobs:
  codesee:
    uses: wayofdev/gh-actions/.github/workflows/create-arch-diagram.yml@master
    with:
      os: ubuntu-latest
      continue-on-error: true
    secrets:
      codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}

...

Real-world examples can be found in the wayofdev/laravel-package-tpl repository.


โ†’ Static Analysis

shellcheck.yml:

This workflow uses redhat-plumbers-in-action/differential-shellcheck to run shell script analysis.

Here is an example of how to use this workflow:

.github/workflows/shellcheck.yml
---

on:  # yamllint disable-line rule:truthy
  pull_request:

name: ๐Ÿž Differential shell-check

permissions:
  contents: read

jobs:
  shellcheck:
    uses: wayofdev/gh-actions/.github/workflows/shellcheck.yml@master
    with:
      os: ubuntu-latest
      severity: warning
    secrets:
      token: ${{ secrets.GITHUB_TOKEN }}

...

Real-world examples can be found in the wayofdev/laravel-package-tpl repository.


๐Ÿค License

Licence


๐Ÿ”’ Security Policy

This project has a security policy.


๐Ÿ™Œ Want to Contribute?

Thank you for considering contributing to the wayofdev community! We are open to all kinds of contributions. If you want to:

  • ๐Ÿค” Suggest a feature
  • ๐Ÿ› Report an issue
  • ๐Ÿ“– Improve documentation
  • ๐Ÿ‘จโ€๐Ÿ’ป Contribute to the code

You are more than welcome. Before contributing, kindly check our contribution guidelines.


๐ŸŒ Social Links


๐Ÿ‘จโ€๐Ÿ’ป Author Information

Created in 2023 by lotyp @ wayofdev


๐Ÿงฑ Useful Resources


๐Ÿซก Contributors

Contributors Badge


gh-actions's People

Contributors

fenikks avatar igomur avatar jevgenijsblaus avatar lotyp avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ygorluiz cycle

gh-actions's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/apply-labels.yml
  • actions/labeler v5
.github/workflows/auto-merge-release.yml
  • peter-evans/enable-pull-request-automerge v3
.github/workflows/build-image.yml
  • actions/checkout v4
  • e1himself/goss-installation-action v1.2.1
  • docker/metadata-action v5
  • docker/login-action v3
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/build-push-action v5
.github/workflows/create-arch-diagram.yml
  • Codesee-io/codesee-action v2
.github/workflows/create-changesets-release.yml
  • actions/checkout v4
  • actions/setup-node v4
  • changesets/action v1
.github/workflows/create-release.yml
  • google-github-actions/release-please-action v4
.github/workflows/integrate.yml
  • actions/checkout v4.1.3
  • wagoid/commitlint-github-action v6.0.1
  • actions/checkout v4.1.3
  • ibiqlik/action-yamllint v3.1.1
.github/workflows/release.yml
  • google-github-actions/release-please-action v4
.github/workflows/shellcheck.yml
  • actions/checkout v4
  • redhat-plumbers-in-action/differential-shellcheck v5
  • actions/upload-artifact v4
.github/workflows/triage.yml
  • wayofdev/gh-actions v3.0.0
actions/phive/install/action.yml
  • actions/cache v4.0.2
actions/playwright/install/action.yml
  • actions/cache v4
actions/pnpm/install/action.yml
  • pnpm/action-setup v2
  • actions/cache v4
  • actions/cache v4
npm
package.json

  • Check this box to trigger a request for Renovate to run again on this repository

Update README.md

Tasks:

  • Include missing workflows and actions.
  • Upgrade docker build workflow
  • Connect own CI workflows with release-please and releases
  • Connect renovatebot
  • Re-write release-please action to use v4 version

Change "Merge pull requet..." message to be valid for conventional-commits

          > [!TIP]

Codebase Verification

The verification process revealed that the current commitlint configuration does not account for merge commits, such as "Merge pull request #50 from wayofdev/feat/pnpm-install". These are common in projects that use pull requests. It would be beneficial to either adjust the type-enum to include a type for merge commits or modify the ignore pattern to exclude these commits from linting checks. This ensures that the commitlint rules align more closely with the project's actual commit practices.

Analysis chain

Ensure that the commitlint rules align with the project's commit conventions. Particularly, verify the header-max-length and type-enum rules to ensure they cover all necessary commit types.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for commits in the last 50 that might not adhere to the defined types
git log -50 --pretty=format:%s | grep -vE '^(feat|fix|perf|docs|style|deps|refactor|ci|test|revert|build|chore|security):'

Length of output: 179

Originally posted by @coderabbitai[bot] in #51 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.