https://github.com/juicycleff/actions
GitHub actions for Micro services
https://github.com/juicycleff/actions
Last synced: 8 months ago
JSON representation
GitHub actions for Micro services
- Host: GitHub
- URL: https://github.com/juicycleff/actions
- Owner: juicycleff
- License: mit
- Created: 2020-02-28T22:33:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-28T23:44:57.000Z (over 5 years ago)
- Last Synced: 2024-04-14T09:58:57.052Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 225 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Action: Changed Services
Assuing a mono-repo folder structure, where the top level directories are services,
this GitHub action extracts the services which were modified in the last commit. It
works for both single commits and pull requests.The GitHub action requires one input: githubToken, this is provided by default by
GitHub actions, and can be accessed via: `${{ secrets.GITHUB_TOKEN }}`.The outputs provided are lists of services which have been changed, encoded in a string
with ` ` as the seperator. It can be used as an array in bash as demonstrated below.## How to Use
```
name: extract-serviceson:
push:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Detect which services changed
id: services_changed
uses: micro/actions@1.0.19
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
- name: test
run: |
cat $HOME/changes.json
echo '${{ steps.services_changed.outputs.services }}'echo Logging services added
services=(${{ steps.services_changed.outputs.services_added }})
for dir in "${services[@]}"; do
echo Added $dir
doneecho Logging services modified
services=(${{ steps.services_changed.outputs.services_modified }})
for dir in "${services[@]}"; do
echo Modified $dir
doneecho Logging services removed
services=(${{ steps.services_changed.outputs.services_removed }})
for dir in "${services[@]}"; do
echo Removed $dir
doneecho Done
```