Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test new workflow #272

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/registry-updates-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Update Hub DB from GH Registry (Testing)

on:
pull_request:
branches:
- main
- kc/test-workflow
types: [opened, synchronize, reopened]
paths:
- registry/**


jobs:
update_registry_db:
runs-on: ubuntu-latest
environment: test

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch_depth: 1

- name: Check for PR approvals
id: check-approval
uses: actions/github-script@v7
with:
script: |
const { owner, repo } = context.issue;
const pull_number = context.payload.pull_request.number;
console.log("Owner and repo and pull_number", owner, repo, pull_number);
const { data: reviews } = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
});
const approved = reviews.some(review => review.state === 'APPROVED');
if (!approved) {
core.setFailed('This workflow will only run when the PR is approved by someone in Hasura')
}

- 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: ${{ secrets.GCP_BUCKET_NAME }}
GCP_SERVICE_ACCOUNT_DETAILS: ${{ secrets.GCP_SERVICE_ACCOUNT_DETAILS }}
CONNECTOR_PUBLICATION_KEY: ${{ secrets.CONNECTOR_PUBLICATION_KEY }}
CLOUDINARY_URL: ${{ secrets.CLOUDINARY_URL }}
run: |
mv changed_files.json registry-automation/changed_files.json
cd registry-automation
go run main.go ci
1 change: 1 addition & 0 deletions registry/hasura/azure-cosmos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,4 @@ We're happy to receive any contributions from the community. Please refer to our
## License

The Hasura Azure Cosmos DB for NoSQL connector is available under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
blah
Loading