PR Changes Matrix Builder

Overview

PR Changes Matrix Builder

This Action will generate a output variable that can be used to generate a dynamic matrix job.

This is often need for repos that contain many apps, here are a few examples:

  • Terraform Infrastructure: At my current job we have a single repo with all of our cloud infrastructure. Each folder is deployed individually, so being able to detect what folders have been changed can build a matrix for each terraform plan command.

  • ArgoCD: This is a single repo with all of our ArgoCD apps. Each folder is deployed individually, so being able to detect what folders have been changed can build a matrix for each ArgoCD command.

  • Helm chart: At my current job we have a collection of generic helm charts. Each folder is a chart that is individually deployed, tagged, and released.

This action is based on a quick POC in KyleJamesWalker/action-playground PR#3 and expands on a command like:

# Github Command
$ gh pr view 3 --repo KyleJamesWalker/action-playground --json files --jq '.files.[].path' | cut -d "/" -f1 | grep -v '[\\|\.]' | sort | uniq | jq  --raw-input .

# Example Output
"example_1"
"example_2"

Docker Image Sizes

  • kylejameswalker/pr-changes-matrix-builder-pytest 308MB
  • kylejameswalker/pr-changes-matrix-builder 254MB
You might also like...
Automatically commits and pushes changes from a specified directory to remote repository

autopush a simple python program that checks a directory for updates and automatically commits any updated files (and optionally pushes them) installa

A simple script that loads and hot-reloads cogs when you save any changes

DiscordBot-HotReload A simple script that loads and hot-reloads cogs when you save any changes Usage @bot.event async def on_ready(): from HotRelo

Lambda-function - Python codes that allow notification of changes made to some services using the AWS Lambda Function
Lambda-function - Python codes that allow notification of changes made to some services using the AWS Lambda Function

AWS Lambda Function This repository contains python codes that allow notificatio

A Matrix-Instagram DM puppeting bridge

mautrix-instagram A Matrix-Instagram DM puppeting bridge. Documentation All setup and usage instructions are located on docs.mau.fi. Some quick links:

Matrix trivia bot with python

Matrix-trivia-bot Getting started See SETUP.md for how to setup and run the template project. Project structure A reference of each file included in t

An example of matrix addition, demonstrating the basic method of Python calling C library functions

Example for Python call C functions An example of matrix addition, demonstrating the basic method of Python calling C library functions. How to run Bu

The worst but simplest webhook bot for GitHub and Matrix.
The worst but simplest webhook bot for GitHub and Matrix.

gh-bot gh-bot is maybe the worst (but simplest) Matrix webhook bot for Github. Example of commits: Example of workflow finished: Setting up Server You

A template / demo bot for the Halcyon matrix bot library
A template / demo bot for the Halcyon matrix bot library

Halcyon stock bot Hello! This is an example / template bot using the halcyon matrix bot library. Feel free to ask questions in the matrix chat #halcyo

Companion "receiver" to matrix-appservice-webhooks for [matrix].

Matrix Webhook Receiver Companion "receiver" to matrix-appservice-webhooks for [matrix]. The purpose of this app is to listen for generic webhook mess

Main repository for the Sphinx documentation builder

Sphinx Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of mul

Virtual Python Environment builder

virtualenv A tool for creating isolated virtual python environments. Installation Documentation Changelog Issues PyPI Github Code of Conduct Everyone

PyPika is a python SQL query builder that exposes the full richness of the SQL language using a syntax that reflects the resulting query. PyPika excels at all sorts of SQL queries but is especially useful for data analysis.

PyPika - Python Query Builder Abstract What is PyPika? PyPika is a Python API for building SQL queries. The motivation behind PyPika is to provide a s

Main repository for the Sphinx documentation builder

Sphinx Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of mul

sphinx builder that outputs markdown files.
sphinx builder that outputs markdown files.

sphinx-markdown-builder sphinx builder that outputs markdown files Please ★ this repo if you found it useful ★ ★ ★ If you want frontmatter support ple

gnosis safe tx builder

Ape Safe: Gnosis Safe tx builder Ape Safe allows you to iteratively build complex multi-step Gnosis Safe transactions and safely preview their side ef

A URL builder for genius :D

genius-url A URL builder for genius :D Usage from gurl import genius_url

Piccolo - A fast, user friendly ORM and query builder which supports asyncio.

A fast, user friendly ORM and query builder which supports asyncio.

This open-source python3 script is a builder to the very popular token logger that is on my github that many people use.
This open-source python3 script is a builder to the very popular token logger that is on my github that many people use.

Discord-Logger-Builder This open-source python3 script is a builder to the very popular token logger that is on my github that many people use. This i

Que es S4K Builder?, Fácil un constructor de tokens grabbers con muchas opciones, como BTC Miner, Clipper, shutdown PC, Y más! Disfrute el proyecto. 3

S4K Builder Este script Python 3 de código abierto es un constructor del muy popular registrador de tokens que está en [mi GitHub] (https://github.com

Comments
  • First Version

    First Version

    The following has been done:

    • Auth with gh cli
    • Pull changes from a PR with gh cli
    • Generate a matrix with hardcoded values
    • Explicitly include and ignore files
    • Hardcoded workflow to against a remote repo's PR
    • Tests with testing workflow

    Still needs the following:

    • Examples in the docs
    • Better optional inputs (all required right now, need tests to handle possible combinations)

    PRs will have the following tests:

    • A static reference to a known PR
    • A static reference to a known PR without any files changes (blank matrix)
    • A pytest run to add tests.

    image

    opened by KyleJamesWalker 0
  • Improve the Docs

    Improve the Docs

    I need to improve the docs, with a sample repo like the following:

    Folder structure:

    .
    ├── Makefile
    ├── README.md
    ├── example-1
    │   └── README.md
    └── example-2
        └── README.md
    

    Example workflow:

    name: Test PR
    
    on:
      pull_request:
        types: [edited, opened, synchronize, reopened]
        branches: [master]
    
    jobs:
    
      pr-changes:
        runs-on: ubuntu-latest
    
        outputs:
          matrix-params: ${{ steps.matrix-builder.outputs.matrix }}
          matrix-populated: ${{ steps.matrix-builder.outputs.matrix-populated }}
    
        steps:
          - name: PR Changes Matrix Builder
            uses: KyleJamesWalker/[email protected]
            id: matrix-builder
            with:
              inject_primary_key: project_name
              extract_re: '(?P<project_name>.*)/.*'
              # Only changes in folders, nothing in the root should be included
              paths_include: '["**/**"]'
              paths_ignore: '[".github/**"]'
    
      test-pr:
        needs: [pr-changes]
        if: needs.pr-changes.outputs.matrix-populated == 'true'
        runs-on: ubuntu-latest
    
        strategy:
          matrix:
            params: ${{ fromJson(needs.pr-changes.outputs.matrix-params ) }}
    
        steps:
          - uses: actions/[email protected]
    
          - name: Test
            run: make test project_name=${{ matrix.params.project_name }}
    
    

    Example Makefile:

    protocol ?= unset
    
    test:
    	@echo Testing protocol = ${protocol}
    
    

    This will run make test protocl=xxx for each folder that has changes in it, but it will also ignore changes in the .github and root folers.

    opened by KyleJamesWalker 0
Releases(v0.0.1)
  • v0.0.1(Jan 20, 2022)

    What's Changed

    • First Version by @KyleJamesWalker in https://github.com/KyleJamesWalker/pr-changes-matrix-builder/pull/1

    New Contributors

    • @KyleJamesWalker made their first contribution in https://github.com/KyleJamesWalker/pr-changes-matrix-builder/pull/1

    Full Changelog: https://github.com/KyleJamesWalker/pr-changes-matrix-builder/commits/v0.0.1

    Source code(tar.gz)
    Source code(zip)
Owner
Kyle James Walker (he/him)
Kyle James Walker (he/him)
Example notebooks for working with SageMaker Studio Lab. Sign up for an account at the link below!

SageMaker Studio Lab Sample Notebooks Available today in public preview. If you are looking for a no-cost compute environment to run Jupyter notebooks

Amazon Web Services 304 Jan 01, 2023
The open source version of Tentro - A multipurpose Discord bot.

Welcome to Tentro 👋 A multipurpose Discord bot. 🏠 Homepage Install pip install -r requirements.txt Usage py Tentro.py Contributors 👤 Tentro Dev Tea

6 Jul 14, 2022
Simple, yet effective moderator bot for telegram. With reports, logs, profanity filter and more :3

👹 Samurai Telegram Bot Simple, yet effective moderator bot for telegram. With reports, logs, profanity filter and more :3 Description Personal bot, m

Abraham Tugalov 106 Dec 13, 2022
Discord bot template.py

discord_bot_template.py A minimal and open-source discord.py boilerplate for kick-starting bot projects. I spend a lot of time developing bots for dif

Tarran Prior 1 Feb 24, 2022
An attempt to make a bot that can auto-archive Danganronpa KG RPs on Discord.

Danganronpa Killing Game Archiving Bot An attempt to make a bot that can auto-archive Danganronpa KG RPs on Discord. The final format is meant to look

Astrea 1 Nov 30, 2021
Python3 program to control Elgato Ring Light on your local network without Elgato's Control Center software

Elgato Light Controller I'm really happy with my Elgato Key Light from an illumination perspective. However, their control software has been glitchy f

Jeff Tarr 14 Nov 16, 2022
D(HE)ater is a security tool can perform DoS attack by enforcing the DHE key exchange.

D(HE)ater D(HE)ater is an attacking tool based on CPU heating in that it forces the ephemeral variant of Diffie-Hellman key exchange (DHE) in given cr

Balasys 138 Dec 15, 2022
Deezer client for python

Deezer Python Client A friendly Python wrapper around the Deezer API. Installation The package is published on PyPI and can be installed by running: p

Bruno Alla 103 Dec 19, 2022
Python functions to run WASS stereo wave processing executables, and load and post process WASS output files.

wass-pyfuns Python functions to run the WASS stereo wave processing executables, and load and post process the WASS output files. General WASS (Waves

Mika Malila 3 May 13, 2022
A Python 2.7/3.x module for Amcrest Cameras using the SDK HTTP API.

A Python 2.7/3.x module for Amcrest Cameras using the SDK HTTP API. Amcrest and Dahua devices share similar firmwares. Dahua Cameras and NVRs also work with this module.

Marcelo Moreira de Mello 176 Dec 21, 2022
Deploy a STAC API and a dynamic mosaic tiler API using AWS CDK.

Earth Observation API Deploy a STAC API and a dynamic mosaic tiler API using AWS CDK.

Development Seed 39 Oct 30, 2022
Get random jokes bapack2 from jokes-bapack2-api

Random Jokes Bapack2 Get random jokes bapack2 from jokes-bapack2-api Requirements Python Requests HTTP library How to Run py random-jokes-bapack2.py T

Miftah Afina 1 Nov 18, 2021
Discord.py(disnake) selfbot

Zzee selfbot Discord.py selfbot Version: 1.0 ATTENTION! we are not responsible for your discord account! this program violates the ToS discord rules!

1 Jan 10, 2022
A youtube search telegram bot.

YouTube-Search-Bot A youtube search telegram bot. Made with Python3 (C) @FayasNoushad Copyright permission under MIT License License - https://github

Fayas Noushad 22 Nov 12, 2022
This very basic script can be used to automate COVID-19 vaccination slot booking on India's Co-WIN Platform.

COVID-19 Vaccination Slot Booking Script This very basic CLI based script can be used to automate covid vaccination slot booking on Co-WIN Platform. I

605 Dec 14, 2022
OGE-2022-na-Python - Solving problems in python for the OGE 2022

OGE-2022-na-Python Решение задачек на питоне для ОГЭ 2022 Тут разобраны разные в

Slava 0 Oct 14, 2022
This repo contains a simple library for work with Eitaa messenger's api

Eitaa PyKit This repo contains a simple library for work with Eitaa messenger's api PyPI Page : https://pypi.org/project/Eitaa-PyKit Install via pip p

Bistcuite 20 Sep 16, 2022
Automated crypto trading bot as adapted from Algovibes.

crypto-trading-bot Automated crypto trading bot as adapted from Algovibes. Pre-requisites Ensure that you have created a Binance API key before procee

Kai Koh 33 Nov 01, 2022
A python package for AxisVM

PyAxisVM The package is under development. Follow us on social media, where we'll announce the first release! Overview The PyAxisVM project offers a h

AxisVM - InterCAD 8 Nov 19, 2022
Python script to harvest tweets with the Twitter API V2 Academic Research Product Track

Tweet harvester Python script to scrape, collect, and/or harvest tweets with the Twitter API V2 Academic Research Product Track. Important note: In or

Thomas Frissen 2 Nov 11, 2021