Skip to content

Commit fa621c1

Browse files
authored
add candigv3 dispatch (#387)
1 parent 39ea458 commit fa621c1

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

.github/workflows/candig-dispatch.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [develop]
66
types: [closed]
77
jobs:
8-
CanDIG-dispatch:
8+
CanDIGv2-dispatch:
99
runs-on: ubuntu-latest
1010
env:
1111
PARENT_REPOSITORY: CanDIG/CanDIGv2
@@ -41,3 +41,39 @@ jobs:
4141
pr_description: "PR triggered by update to develop branch on ${{ github.repository }}. Commit hash: `${{ github.sha }}`. PR link: [#${{ env.PR_NUMBER }}](https://github.com/${{ github.repository }}/pull/${{ env.PR_NUMBER }})"
4242
owner: ${{ env.OWNER }}
4343
submodule_path: lib/htsget/htsget_app
44+
CanDIGv3-dispatch:
45+
runs-on: ubuntu-latest
46+
env:
47+
PARENT_REPOSITORY: CanDIG/CanDIGv3
48+
CHECKOUT_BRANCH: develop
49+
PR_AGAINST_BRANCH: develop
50+
OWNER: CanDIG
51+
if: github.event.pull_request.merged == true
52+
steps:
53+
- name: Check out repository code
54+
uses: actions/checkout@v4
55+
- name: get PR data
56+
shell: python
57+
run: |
58+
import json
59+
import os
60+
with open('${{ github.event_path }}') as fh:
61+
event = json.load(fh)
62+
escaped = event['pull_request']['title'].replace("'", '"')
63+
pr_number = event["number"]
64+
print(escaped)
65+
with open(os.environ['GITHUB_ENV'], 'a') as fh:
66+
print(f'PR_TITLE={escaped}', file=fh)
67+
print(f'PR_NUMBER={pr_number}', file=fh)
68+
- name: Create PR in CanDIGv3
69+
id: make_pr
70+
uses: CanDIG/github-action-pr-expanded@v4
71+
with:
72+
github_token: ${{ secrets.SUBMODULE_PR }}
73+
parent_repository: ${{ env.PARENT_REPOSITORY }}
74+
checkout_branch: ${{ env.CHECKOUT_BRANCH}}
75+
pr_against_branch: ${{ env.PR_AGAINST_BRANCH }}
76+
pr_title: "${{ github.repository }} merging: ${{ env.PR_TITLE }}"
77+
pr_description: "PR triggered by update to develop branch on ${{ github.repository }}. Commit hash: `${{ github.sha }}`. PR link: [#${{ env.PR_NUMBER }}](https://github.com/${{ github.repository }}/pull/${{ env.PR_NUMBER }})"
78+
owner: ${{ env.OWNER }}
79+
submodule_path: lib/htsget/htsget_app

0 commit comments

Comments
 (0)