Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
keiththompson committed Nov 29, 2020
0 parents commit da78b90
Show file tree
Hide file tree
Showing 11 changed files with 7,138 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: keefy
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: [push]

jobs:
generate_build_matrix:
runs-on: ubuntu-latest
name: Generate build matrix.
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate Build Matrix
uses: ./
id: generate_build_matrix
with:
repo-token: ${{ secrets.MY_GITHUB_TOKEN }}
- name: Print the output
run: |
echo "The build matrix is ${{ steps.generate_build_matrix.outputs.build_matrix }}"
echo "Build matrix empty: ${{ steps.generate_build_matrix.outputs.is_empty }}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Keith Thompson

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# detected-changes-action

This action generates a build matrix dynamically based on where files are changed in the diff from the default branch.

## Inputs

### `repo-token`

The Github token used to authenticate.

### `target-directory`

An optional directory to listen to changes under.

### `depth`

How many levels deep to search for changes.

## Outputs

### `build_matrix`

The generated build matrix.

### `is_empty`

Returns true if the build matrix is empty.

## Example usage

```yaml
name: Generate Build Matrix
uses: keiththompson/[email protected]
id: generate_build_matrix
with:
repo-token: ${{ secrets.MY_GITHUB_TOKEN }}
target-directory: projects
depth: 3
```
21 changes: 21 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Generate build matrix'
description: 'A job that generates a build matrix based on files changed'
inputs:
repo-token:
description: 'The github token used to authenticate'
required: true
depth:
description: 'How many levels deep should the directories be returned'
required: true
default: 2
target-directory:
description: 'An optional target directory to listen to changes in'
required: false
outputs:
build_matrix:
description: 'The files changed between the default branch and the sha being built'
is_empty:
description: 'Returns true when the build matrix is empty'
runs:
using: 'node12'
main: 'dist/index.js'
569 changes: 569 additions & 0 deletions dist/LICENSE

Large diffs are not rendered by default.

Loading

0 comments on commit da78b90

Please sign in to comment.