-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: PLT-647: Follow Merge for reverts
- Loading branch information
1 parent
ba2db75
commit 2975b0b
Showing
1 changed file
with
14 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: 'Follow Merge: Sync PR LSE' | ||
name: 'Follow Merge: Dispatch' | ||
|
||
on: | ||
pull_request_target: | ||
|
@@ -14,13 +14,10 @@ on: | |
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
|
||
env: | ||
DOWNSTREAM_REPOSITORY: "label-studio-enterprise" | ||
|
||
jobs: | ||
sync: | ||
name: "Sync" | ||
if: startsWith(github.head_ref, 'fb-') | ||
if: startsWith(github.head_ref, 'fb-') || (startsWith(github.head_ref, 'revert-') && contains(github.head_ref, '-fb-') ) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: hmarr/[email protected] | ||
|
@@ -55,25 +52,20 @@ jobs: | |
body: [ | ||
'Hi @${{ github.actor }}!', | ||
'', | ||
`Unfortunately you don't have membership in ${owner} organization, your PR wasn't synced with ${owner}/${{ env.DOWNSTREAM_REPOSITORY }}.` | ||
`Unfortunately you don't have membership in ${owner} organization, Follow Merge dispatch is skipped.` | ||
].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 }} | ||
- name: Checkout Actions Hub | ||
uses: actions/checkout@v4 | ||
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, | ||
} | ||
}); | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: HumanSignal/actions-hub | ||
path: ./.github/actions-hub | ||
|
||
- name: Dispatch label-studio-enterprise Follow Merge | ||
uses: ./.github/actions-hub/actions/follow-merge-dispatch | ||
with: | ||
github_token: ${{ secrets.GIT_PAT }} | ||
downstream_repository: "label-studio-enterprise" |