feat :: toleration #84
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Helm Chart Version | |
on: | |
push: | |
paths: | |
- 'charts/**/Chart.yaml' | |
jobs: | |
check-version: | |
runs-on: ubuntu-latest | |
outputs: | |
charts: ${{ steps.check-version.outputs.charts }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- name: Check Chart Version | |
id: check-version | |
run: | | |
echo "{\"include\":[]}" > chart.json | |
git diff --name-only HEAD^ HEAD | grep Chart.yaml | while read line; do | |
CHART=$(grep '^name: ' $line | cut -d ' ' -f 2) | |
VERSION=$(grep '^version: ' $line | cut -d ' ' -f 2) | |
jq --arg CHART "$CHART" --arg VERSION "$VERSION" '.include += [{"chart":$CHART,"version":$VERSION}]' chart.json > temp.json && mv temp.json chart.json | |
done | |
echo "charts=$(jq -c . < ./chart.json)" >> $GITHUB_OUTPUT | |
cat chart.json | |
repository-dispatch: | |
needs: check-version | |
strategy: | |
matrix: ${{fromJson(needs.check-version.outputs.charts)}} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Repository Dispatch | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.GHP_TOKEN }} | |
repository: team-xquare/xquare-infrastructure-global | |
event-type: chart-update | |
client-payload: | | |
{ | |
"chart": "${{ matrix.chart }}", | |
"version": "${{ matrix.version }}" | |
} |