Skip to content

Commit

Permalink
Merge branch 'master' into fb-dia-1415-2
Browse files Browse the repository at this point in the history
  • Loading branch information
niklub authored Oct 16, 2024
2 parents 76b8f65 + 63e8645 commit d853a9c
Show file tree
Hide file tree
Showing 6 changed files with 278 additions and 95 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/follow-merge-sync-pr-adala.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: 'Follow Merge: Sync PR Adala'

on:
pull_request_target:
types:
- opened
- closed
- converted_to_draft
- ready_for_review
- synchronize
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}

env:
DOWNSTREAM_REPOSITORY: "Adala"

jobs:
sync:
name: "Sync"
if: startsWith(github.head_ref, 'fb-')
runs-on: ubuntu-latest
steps:
- uses: hmarr/[email protected]

- name: Check user's membership
if: github.actor != 'fern-api[bot]'
uses: actions/github-script@v7
id: check-membership
with:
github-token: ${{ secrets.GIT_PAT }}
script: |
const { repo, owner } = context.repo;
try {
return (await github.rest.orgs.getMembershipForUser({
org: owner,
username: '${{ github.actor }}',
}))?.data?.state == "active";
} catch (error) {
return false;
}
- name: Notify user on failure
if: steps.check-membership.outputs.result == 'false'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GIT_PAT }}
script: |
const { repo, owner } = context.repo;
const result = await github.rest.issues.createComment({
owner,
repo,
issue_number: '${{ github.event.number }}',
body: [
'Hi @${{ github.actor }}!',
'',
`Unfortunately you don't have membership in ${owner} organization, your PR wasn't synced with ${owner}/${{ env.DOWNSTREAM_REPOSITORY }}.`
].join('\n')
});
throw `${{ github.actor }} don't have membership in ${owner} organization`
- name: Checkout Actions Hub
uses: actions/checkout@v4
with:
token: ${{ secrets.GIT_PAT }}
repository: HumanSignal/actions-hub
path: ./.github/actions-hub

- name: Dispatch Follow Merge Event
uses: ./.github/actions-hub/actions/follow-merge-dispatch
with:
github_token: ${{ secrets.GIT_PAT }}
downstream_repository: "${{ env.DOWNSTREAM_REPOSITORY }}"
6 changes: 6 additions & 0 deletions .mock/definition/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2375,6 +2375,12 @@ types:
type: optional<RefinedPromptResponseRefinementStatus>
docs: Status of the refinement job
default: Pending
total_cost:
type: optional<float>
docs: Total cost of the refinement job (in USD)
previous_version:
type: optional<PromptVersion>
docs: Previous version of the prompt
source:
openapi: openapi/openapi.yaml
InferenceRunOrganization:
Expand Down
24 changes: 24 additions & 0 deletions .mock/definition/prompts/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ service:
prompt: prompt
refinement_job_id: refinement_job_id
refinement_status: Pending
total_cost: 1.1
previous_version:
title: title
parent_model: 1
model_provider_connection: 1
prompt: prompt
provider: OpenAI
provider_model_id: provider_model_id
created_by: 1
created_at: '2024-01-15T09:30:00Z'
updated_at: '2024-01-15T09:30:00Z'
organization: 1
audiences:
- public
refine_prompt:
Expand Down Expand Up @@ -249,6 +261,18 @@ service:
prompt: prompt
refinement_job_id: refinement_job_id
refinement_status: Pending
total_cost: 1.1
previous_version:
title: title
parent_model: 1
model_provider_connection: 1
prompt: prompt
provider: OpenAI
provider_model_id: provider_model_id
created_by: 1
created_at: '2024-01-15T09:30:00Z'
updated_at: '2024-01-15T09:30:00Z'
organization: 1
audiences:
- public
source:
Expand Down
Loading

0 comments on commit d853a9c

Please sign in to comment.