Skip to content

fix: storage parameter fixes #7103

fix: storage parameter fixes

fix: storage parameter fixes #7103

name: 'Follow Merge: Sync PR LSE'
on:
pull_request_target:
types:
- opened
- closed
- converted_to_draft
- ready_for_review
- synchronize
branches:
- develop
- 'lse-release/**'
paths-ignore:
- 'label_studio/frontend/**'
- 'docs/**'
# - 'web/dist/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
env:
DOWNSTREAM_REPOSITORY: "label-studio-enterprise"
jobs:
sync:
name: "Sync"
if: startsWith(github.head_ref, 'fb-')
runs-on: ubuntu-latest
steps:
- uses: hmarr/[email protected]
- name: Check user's membership
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: Dispatch Follow Merge Workflow
uses: actions/github-script@v7
env:
BRANCH_NAME: ${{ github.head_ref }}
with:
github-token: ${{ secrets.GIT_PAT }}
script: |
const branch_name = process.env.BRANCH_NAME;
github.rest.actions.createWorkflowDispatch({
owner: "HumanSignal",
repo: "label-studio-enterprise",
workflow_id: "follow-merge-upstream-repo-sync-v2.yml",
ref: "develop",
inputs: {
branch_name: branch_name,
}
});