Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
ci: use git diff to add `M-database-changes` label for pr that contains migrations and schema changes (#4625)
Shankar Singh C49c9f1944b17
diff --git a/.github/workflows/pr-convention-checks.yml b/.github/workflows/pr-convention-checks.ymlindex f8afdb5380..bceb49fd90 100644--- a/.github/workflows/pr-convention-checks.yml+++ b/.github/workflows/pr-convention-checks.yml@@ -128,3 +128,60 @@ jobs:exit 1fidone <<< "${linked_issues}"++ pr_labeler:+ name: Attach suitable labels to PR+ if: ${{ github.event_name == 'pull_request_target' }}+ runs-on: ubuntu-latest++ steps:+ - name: Generate GitHub app token+ id: generate_app_token+ uses: actions/create-github-app-token@v1+ with:+ app-id: ${{ secrets.HYPERSWITCH_BOT_APP_ID }}+ private-key: ${{ secrets.HYPERSWITCH_BOT_APP_PRIVATE_KEY }}+ owner: ${{ github.event.repository.owner.login }}++ - name: Get files changed+ env:+ GH_TOKEN: ${{ steps.generate_app_token.outputs.token }}+ shell: bash+ run: |+ migration_and_schema_changes=false+ openapi_changes=false++ files_changed="$(gh api --header "Accept: application/vnd.github+json" --header "X-GitHub-Api-Version: 2022-11-28" --paginate https://api.github.com/repos/juspay/hyperswitch/pulls/${{ github.event.pull_request.number }}/files --jq '.[] | .filename')"++ if echo "${files_changed}" | grep --quiet --extended-regexp '(^migrations/.*/(up|down)\.sql$|^crates/diesel_models/src/schema.rs$)' ; then+ migration_and_schema_changes='true'+ fi++ if echo "${files_changed}" | grep --quiet --extended-regexp '^(api-reference/openapi_spec.json)$'; then+ openapi_changes='true'+ fi++ echo "migration_and_schema_changes=${migration_and_schema_changes}" >> "${GITHUB_ENV}"+ echo "openapi_changes=${openapi_changes}" >> "${GITHUB_ENV}"++ - name: Add/Remove 'M-database-changes' based on Migration or Schema changes+ shell: bash+ env:+ GH_TOKEN: ${{ steps.generate_app_token.outputs.token }}+ run: |+ if ${{ env.migration_and_schema_changes == 'true' }}; then+ gh --repo ${{ github.event.repository.full_name }} pr edit --add-label 'M-database-changes' ${{ github.event.pull_request.number }}+ else+ gh --repo ${{ github.event.repository.full_name }} pr edit --remove-label 'M-database-changes' ${{ github.event.pull_request.number }}+ fi++ - name: Add/Remove 'M-api-contract-changes' based on OpenAPI Spec changes+ shell: bash+ env:+ GH_TOKEN: ${{ steps.generate_app_token.outputs.token }}+ run: |+ if ${{ env.openapi_changes == 'true' }}; then+ gh --repo ${{ github.event.repository.full_name }} pr edit --add-label 'M-api-contract-changes' ${{ github.event.pull_request.number }}+ else+ gh --repo ${{ github.event.repository.full_name }} pr edit --remove-label 'M-api-contract-changes' ${{ github.event.pull_request.number }}+ fi