Skip to content

Commit

Permalink
ci: PLT-647: Follow Merge for reverts
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitabelonogov committed Feb 12, 2025
1 parent ba2db75 commit 2975b0b
Showing 1 changed file with 14 additions and 22 deletions.
36 changes: 14 additions & 22 deletions .github/workflows/follow-merge-sync-pr.yml
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:
Expand All @@ -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]
Expand Down Expand Up @@ -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"

0 comments on commit 2975b0b

Please sign in to comment.