Skip to content

Commit d853a9c

Browse files
authored
Merge branch 'master' into fb-dia-1415-2
2 parents 76b8f65 + 63e8645 commit d853a9c

File tree

6 files changed

+278
-95
lines changed

6 files changed

+278
-95
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: 'Follow Merge: Sync PR Adala'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- closed
8+
- converted_to_draft
9+
- ready_for_review
10+
- synchronize
11+
branches:
12+
- master
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref }}
16+
17+
env:
18+
DOWNSTREAM_REPOSITORY: "Adala"
19+
20+
jobs:
21+
sync:
22+
name: "Sync"
23+
if: startsWith(github.head_ref, 'fb-')
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: hmarr/[email protected]
27+
28+
- name: Check user's membership
29+
if: github.actor != 'fern-api[bot]'
30+
uses: actions/github-script@v7
31+
id: check-membership
32+
with:
33+
github-token: ${{ secrets.GIT_PAT }}
34+
script: |
35+
const { repo, owner } = context.repo;
36+
try {
37+
return (await github.rest.orgs.getMembershipForUser({
38+
org: owner,
39+
username: '${{ github.actor }}',
40+
}))?.data?.state == "active";
41+
} catch (error) {
42+
return false;
43+
}
44+
45+
- name: Notify user on failure
46+
if: steps.check-membership.outputs.result == 'false'
47+
uses: actions/github-script@v7
48+
with:
49+
github-token: ${{ secrets.GIT_PAT }}
50+
script: |
51+
const { repo, owner } = context.repo;
52+
const result = await github.rest.issues.createComment({
53+
owner,
54+
repo,
55+
issue_number: '${{ github.event.number }}',
56+
body: [
57+
'Hi @${{ github.actor }}!',
58+
'',
59+
`Unfortunately you don't have membership in ${owner} organization, your PR wasn't synced with ${owner}/${{ env.DOWNSTREAM_REPOSITORY }}.`
60+
].join('\n')
61+
});
62+
throw `${{ github.actor }} don't have membership in ${owner} organization`
63+
64+
- name: Checkout Actions Hub
65+
uses: actions/checkout@v4
66+
with:
67+
token: ${{ secrets.GIT_PAT }}
68+
repository: HumanSignal/actions-hub
69+
path: ./.github/actions-hub
70+
71+
- name: Dispatch Follow Merge Event
72+
uses: ./.github/actions-hub/actions/follow-merge-dispatch
73+
with:
74+
github_token: ${{ secrets.GIT_PAT }}
75+
downstream_repository: "${{ env.DOWNSTREAM_REPOSITORY }}"

.mock/definition/__package__.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,12 @@ types:
23752375
type: optional<RefinedPromptResponseRefinementStatus>
23762376
docs: Status of the refinement job
23772377
default: Pending
2378+
total_cost:
2379+
type: optional<float>
2380+
docs: Total cost of the refinement job (in USD)
2381+
previous_version:
2382+
type: optional<PromptVersion>
2383+
docs: Previous version of the prompt
23782384
source:
23792385
openapi: openapi/openapi.yaml
23802386
InferenceRunOrganization:

.mock/definition/prompts/versions.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,18 @@ service:
200200
prompt: prompt
201201
refinement_job_id: refinement_job_id
202202
refinement_status: Pending
203+
total_cost: 1.1
204+
previous_version:
205+
title: title
206+
parent_model: 1
207+
model_provider_connection: 1
208+
prompt: prompt
209+
provider: OpenAI
210+
provider_model_id: provider_model_id
211+
created_by: 1
212+
created_at: '2024-01-15T09:30:00Z'
213+
updated_at: '2024-01-15T09:30:00Z'
214+
organization: 1
203215
audiences:
204216
- public
205217
refine_prompt:
@@ -249,6 +261,18 @@ service:
249261
prompt: prompt
250262
refinement_job_id: refinement_job_id
251263
refinement_status: Pending
264+
total_cost: 1.1
265+
previous_version:
266+
title: title
267+
parent_model: 1
268+
model_provider_connection: 1
269+
prompt: prompt
270+
provider: OpenAI
271+
provider_model_id: provider_model_id
272+
created_by: 1
273+
created_at: '2024-01-15T09:30:00Z'
274+
updated_at: '2024-01-15T09:30:00Z'
275+
organization: 1
252276
audiences:
253277
- public
254278
source:

0 commit comments

Comments
 (0)