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)
Clipboard-watcher - Keep an eye on the apps that are using your clipboard

clipboard-watcher This repository contains the code of an experiment, in order t

Gonçalo Valério 48 Oct 13, 2022
TuShare is a utility for crawling historical data of China stocks

TuShare Tushare Pro版已发布,请访问新的官网了解和查询数据接口! https://tushare.pro TuShare是实现对股票/期货等金融数据从数据采集、清洗加工 到 数据存储过程的工具,满足金融量化分析师和学习数据分析的人在数据获取方面的需求,它的特点是数据覆盖范围广,接口

挖地兔 11.9k Dec 30, 2022
Telegram bot to provide links of different types of files you send

File To Link Bot - IDN-C-X Telegram bot to provide links of different types of files you send. WHAT CAN THIS BOT DO Is it a nuisance to send huge file

IDNCoderX 3 Oct 26, 2021
A listener for RF >= 4.0 that prints a Stack Trace to console to faster find the code section where the failure appears.

robotframework-stacktrace A listener for RF = 4.0 that prints a Stack Trace to console to faster find the code section where the failure appears. Ins

marketsquare 16 Nov 24, 2022
Minimal telegram voice chat music bot, in pyrogram.

VCBOT Fully working VC (user)Bot, based on py-tgcalls and py-tgcalls-wrapper with minimal features. Deploying To heroku: Local machine/VPS: git clone

Aditya 33 Nov 12, 2022
Python client for Midea dhumidifier

This is a library that allows communication with Midea dehumidifier appliances via the local area network. midea-beautiful-dehumidifier This library a

Nenad Bogojevic 42 Dec 22, 2022
Python API wrapper library for Convex Value API

convex-value-python Python API wrapper library for Convex Value API. Further Links: Convex Value homepage @ConvexValue on Twitter JB on Twitter Authen

Aaron DeVera 2 May 11, 2022
Discord py bot that plays magic the gathering.

Klunker Discord py bot that can play magic the gathering Bug Hunter Hello Bug Hunters. To help out with production of this bot, we need help catching

Aiden Castillo 0 Apr 25, 2022
Unofficial calendar integration with Gradescope

Gradescope-Calendar This script scrapes your Gradescope account for courses and assignment details. Assignment details currently can be transferred to

6 May 06, 2022
Discord heximals: More colors for your bot

DISCORD-HEXIMALS More colors for your bot ! Support : okimii#0434 COLORS ( 742 )

4 Feb 04, 2022
:lock: Python 2.7/3.X client for HashiCorp Vault

hvac HashiCorp Vault API client for Python 3.x Tested against the latest release, HEAD ref, and 3 previous minor versions (counting back from the late

hvac 1k Dec 29, 2022
A light weight Python library for the Spotify Web API

Spotipy A light weight Python library for the Spotify Web API Documentation Spotipy's full documentation is online at Spotipy Documentation. Installat

Paul Lamere 4.2k Jan 06, 2023
A Twitter Bot that retweets and likes tweets with the hashtag #girlscriptwoc and #girlscript, and also follows the user.

GirlScript Winter of Contributing Twitter Bot A Twitter Bot that retweets and likes tweets with the hashtag #girlscriptwoc and #girlscript, and also f

Pranay Gupta 9 Dec 15, 2022
Example of Telegram local API and aiogram 3.x

Telegram Local Full example of Telegram local application. Contains Telegram Bot API Local Telegram Bot API server based on aiogram Bot API Server ima

Oleg A. 9 Sep 16, 2022
A file-based quote bot written in Python

Let's Write a Python Quote Bot! This repository will get you started with building a quote bot in Python. It's meant to be used along with the Learnin

1 Feb 03, 2022
A Telegram Bot to return Youtube Video Tags Using YoutubeTags API

YouTube-TagFind-Bot A Telegram Bot to return Youtube Video Tags Using YoutubeTags API YoutubeTags API Wrapper YoutubeTags is a python third-party api

Nuhman Pk 9 Aug 25, 2022
Another Autoscaler is a Kubernetes controller that automatically starts, stops, or restarts pods from a deployment at a specified time using a cron annotation.

Another Autoscaler Another Autoscaler is a Kubernetes controller that automatically starts, stops, or restarts pods from a deployment at a specified t

Diego Najar 66 Nov 19, 2022
SmartFile API Client (Python).

A SmartFile Open Source project. Read more about how SmartFile uses and contributes to Open Source software. Summary This library includes two API cli

SmartFile 19 Jan 11, 2022
Telegram bot to stream videos in telegram voicechat for both groups and channels

Telegram bot to stream videos in telegram voicechat for both groups and channels. Supports live streams, YouTube videos and telegram media. With record stream support, Schedule streams, and many more

ALBY 9 Feb 20, 2022
A simple Spamming software made in python

Spam-qlk Warning!!! 'I' am not responsible for the 'damage or harm' caused by this 'Software'!!! Use at your own risk!!! Input the message. After you

Aditya kumar 1 Nov 30, 2021