Skip to content

Connector publishing automation #113

Connector publishing automation

Connector publishing automation #113

name: Update Hub DB from GH Registry
on:
pull_request:
branches:
- main
types: [opened, synchronize, reopened]
paths:
- registry/**
jobs:
update_registry_db:
runs-on: ubuntu-latest
environment: staging
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch_depth: 1
- name: Get all connector version package changes
id: connector-version-changed-files
uses: tj-actions/changed-files@v44
with:
json: true
escape_json: false
files: |
registry/**
- name: Print out all the changed filse
env:
ADDED_FILES: ${{ steps.connector-version-changed-files.outputs.added_files }}
MODIFIED_FILES: ${{ steps.connector-version-changed-files.outputs.modified_files }}
DELETED_FILES: ${{ steps.connector-version-changed-files.outputs.deleted_files }}
run: |
echo "{\"added_files\": $ADDED_FILES, \"modified_files\": $MODIFIED_FILES, \"deleted_files\": $DELETED_FILES}" > changed_files.json
- name: List changed files
id: list_files
run: |
cat changed_files.json
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Run registry automation program
env:
CHANGED_FILES_PATH: "changed_files.json"
PUBLICATION_ENV: "staging"
CONNECTOR_REGISTRY_GQL_URL: ${{ secrets.CONNECTOR_REGISTRY_GQL_URL }}
GCP_BUCKET_NAME: dev-connector-platform-registry
GCP_SERVICE_ACCOUNT_DETAILS: ${{ secrets.GCP_SERVICE_ACCOUNT_DETAILS }}
CONNECTOR_PUBLICATION_KEY: ${{ secrets.CONNECTOR_PUBLICATION_KEY }}
run: |
mv changed_files.json registry-automation/changed_files.json
cd registry-automation
go run main.go ci