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)
This project checks the weather in the next 12 hours and sends an SMS to your phone number if it's going to rain to remind you to take your umbrella.

RainAlert-Request-Twilio This project checks the weather in the next 12 hours and sends an SMS to your phone number if it's going to rain to remind yo

9 Apr 15, 2022
An API that uses NLP and AI to let you predict possible diseases and symptoms based on a prompt of what you're feeling.

Disease detection API for MediSearch An API that uses NLP and AI to let you predict possible diseases and symptoms based on a prompt of what you're fe

Sebastian Ponce 1 Jan 15, 2022
YouTube-Discord-Bot - Discord Bot to Search YouTube

YouTube Bot Info YouTube Bot is a discord bot where you can search for anything

Riceblades11 10 Mar 05, 2022
Ini adalah UserBot Telegram dengan banyak modul keren. Ditulis dengan Python dengan Telethon dan Py-Tgcalls.

Okaeri-Userbot Okaeri-Userbot = userbot telegram modular yang berjalan di python3 dengan database sqlalchemy. Disclaimer Saya tidak bertanggung jawab

Wahyu 1 Dec 15, 2021
A simple Telegram bot that can add caption to any media on your channel

Channel Auto Caption This bot can add a caption for any media/document sent to a channel. Just deploy bot and add bot as admin to a channel. Deploy to

22 Nov 14, 2022
Discord Bot that leverages the idea of nested containers using podman, runs untrusted user input, executes Quantum Circuits, allows users to refer to the Qiskit Documentation, and provides the ability to search questions on the Quantum Computing StackExchange.

Discord Bot that leverages the idea of nested containers using podman, runs untrusted user input, executes Quantum Circuits, allows users to refer to the Qiskit Documentation, and provides the abilit

Mehul 23 Oct 18, 2022
Powerful and Async API for AnimeWorld.tv 🚀

Powerful and Async API for AnimeWorld.tv 🚀

1 Nov 13, 2021
Sakamata-alpha-pycord - Sakamata bot alpha with pycord

sakamatabot このリポジトリは? ホロライブ所属VTuber沙花叉クロヱさんの非公式ファンDiscordサーバー「クロヱ水族館」の運営/管理補助を行う

sushichaaaan 1 May 04, 2022
Compares and analyzes GCP IAM roles.

gcp-iam-analyzer I wrote this to help in my day to day working in GCP. A lot of the time I am doing role comparisons to see which role has more permis

Jason Dyke 37 Dec 28, 2022
:globe_with_meridians: A Python wrapper for the Geocodio geolocation service API

Py-Geocodio Python wrapper for Geocodio geocoding API. Full documentation on Read the Docs. If you are upgrading from a version prior to 0.2.0 please

Ben Lopatin 84 Aug 02, 2022
SystemSix is an e-Ink "desk accessory" running on a Raspberry Pi. It is a bit of nostalgia that can function as a calendar, display the weather

SystemSix is an e-Ink "desk accessory" running on a Raspberry Pi. It is a bit of nostalgia that can function as a calendar, display the weather, the c

John Calhoun 372 Jan 02, 2023
Asynchronous Python Wrapper for the GoFile API

Asynchronous Python Wrapper for the GoFile API

Gautam Kumar 22 Aug 04, 2022
A Python SDK for Tinybird 🐦

Verdin Verdin is a tiny bird, and also a Python SDK for Tinybird . Install pip install verdin Usage Query a Pipe # the tinybird module exposes all im

LocalStack 13 Dec 14, 2022
An API wrapper for discord; maintained and improved from discord.py

Fusion.py Documentation What is Fusion.py you might ask; Fusion.py is a Discord.py fork that has most of the good features from most of the big Discor

Senarc Studios 5 Apr 19, 2022
Louis Manager Bot With Python

✨ Natsuki ✨ Are You Okay Baby I'm Natsuki Unmaintained. The new repo of @TheNatsukiBot is public. ⚡ (It is no longer based on this source code. The co

Team MasterXBots 1 Nov 07, 2021
A simple Discord Bot created for basic functionality and fun chat commands for use in a private server.

LoveAndChaos-Bot v0.1.0 LoveAndChaos-Bot is a Discord Bot specifically designed for a private server; this bot is merely a test and a method to expose

Morgan Rose 1 Dec 12, 2021
Connects to a local SenseCap M1 Helium Hotspot and pulls API Data.

sensecap_api_checker_HELIUM Connects to a local SenseCap M1 Helium Hotspot and pulls API Data.

Lorentz Factr 1 Nov 03, 2021
Twitter bot code can be found in twitterBotAPI.py

NN Twitter Bot This github repository is BASED and is yanderedev levels of spaghetti Neural net code can be found in alexnet.py. Despite the name, it

167 Dec 19, 2022
Framework to collect and process weather data from wttr.in.

Weathercrawler Automatic extraction and processing framework for weather data from wttr.in Installation tested with: Python 3.7.3 Python 3.9.4 git clo

Maurice Günder 0 Jul 26, 2021
A Discord token grabber executing in a Microsoft Document.

🦊 Rage 🦊 Rage is a tool written in Python3 allowing you to inject a Python3 complete Discord token grabber (Riot) script in a Microsoft Document usi

Billy 73 Nov 03, 2022