@@ -16,7 +16,6 @@ concurrency:
1616 group : ${{ github.workflow }}-${{ github.head_ref }}
1717
1818env :
19- DOWNSTREAM_REPO_OWNER : heartexlabs
2019 DOWNSTREAM_REPO : label-studio-enterprise
2120
2221jobs :
3332 with :
3433 github-token : ${{ secrets.GIT_PAT }}
3534 script : |
35+ const { repo, owner } = context.repo;
3636 try {
3737 return (await github.rest.orgs.getMembershipForUser({
38- org: '${{ env.DOWNSTREAM_REPO_OWNER }}' ,
38+ org: owner ,
3939 username: '${{ github.actor }}',
4040 }))?.data?.state == "active";
4141 } catch (error) {
5656 body: [
5757 'Hi @${{ github.actor }}!',
5858 '',
59- ' Unfortunately you don\ 't have membership in ${{ env.DOWNSTREAM_REPO_OWNER }} organization, your PR wasn\ 't synced with ${{ env.DOWNSTREAM_REPO }}.'
59+ ` Unfortunately you don't have membership in ${owner} organization, your PR wasn't synced with ${owner}/${{ env.DOWNSTREAM_REPO }}.`
6060 ].join('\n')
6161 });
6262
@@ -70,19 +70,20 @@ jobs:
7070 github-token : ${{ secrets.GIT_PAT }}
7171 script : |
7272 const { repo, owner } = context.repo;
73+ const [pr_owner, pr_repo] = '${{ github.event.pull_request.head.repo.full_name || github.repository }}'.split('/');
7374 let event_action = '${{ github.event.action }}'
7475 let commit_sha = '${{ github.event.pull_request.head.sha }}'
7576 if (${{ github.event.pull_request.merged }}) {
7677 event_action = 'merged'
7778 commit_sha = '${{ github.sha }}'
7879 }
7980 const getCommitResponse = await github.rest.repos.getCommit({
80- owner ,
81- repo ,
81+ pr_owner ,
82+ pr_repo ,
8283 ref: commit_sha
8384 });
8485 const result = await github.rest.repos.createDispatchEvent({
85- owner: '${{ env.DOWNSTREAM_REPO_OWNER }}' ,
86+ owner: owner ,
8687 repo: '${{ env.DOWNSTREAM_REPO }}',
8788 event_type: 'upstream_repo_update',
8889 client_payload: {
0 commit comments