Compare develop and production #67
This file contains hidden or 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: Compare develop and production | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| compare: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Compare develop to production | |
| run: | | |
| SOURCE=develop | |
| TARGET=production | |
| echo "## Changes" >> $GITHUB_STEP_SUMMARY | |
| echo "\`develop\` -> \`production\`" >> $GITHUB_STEP_SUMMARY | |
| echo "| Service | New ($SOURCE) | Current ($TARGET) | Changes |" >> $GITHUB_STEP_SUMMARY | |
| echo "| --- | --- | --- | --- |" >> $GITHUB_STEP_SUMMARY | |
| jq --raw-output '.services | keys[]' "config/$SOURCE.json" | while read -r SERVICE_NAME; do SERVICE_REPO=$(jq --raw-output --arg service "$SERVICE_NAME" '.services[$service].repo' "config/$SOURCE.json") && SERVICE_SOURCE=$(jq --raw-output --arg service "$SERVICE_NAME" '.services[$service].version' "config/$SOURCE.json") && SERVICE_TARGET=$(jq --raw-output --arg service "$SERVICE_NAME" '.services[$service].version' "config/$TARGET.json") && [ "$SERVICE_SOURCE" != "$SERVICE_TARGET" ] && echo "| $SERVICE_NAME | \`$SERVICE_SOURCE\` | \`$SERVICE_TARGET\` | [Compare]($SERVICE_REPO/compare/v$SERVICE_TARGET...v$SERVICE_SOURCE) |" >> $GITHUB_STEP_SUMMARY || echo "| $SERVICE_NAME | \`$SERVICE_SOURCE\` | \`$SERVICE_TARGET\` | [No changes] |" >> $GITHUB_STEP_SUMMARY; done |