Skip to content

Commit 439211c

Browse files
authored
Merge pull request #17 from BranchMetrics/SDK-1950-Add-workflow-dispatch-event
SDK-1950 Updated workflow for manual start.
2 parents 7fbe308 + 4d22352 commit 439211c

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

.github/workflows/import.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: Import release
22

33
on:
4-
repository_dispatch:
4+
workflow_dispatch:
55
inputs:
66
tag:
77
required: true
88
description: A release tag from the iOS repo to import
9+
repository_dispatch:
910

1011
jobs:
1112
import:
@@ -14,25 +15,33 @@ jobs:
1415
MAIN_REPO_OWNER: BranchMetrics
1516
MAIN_REPO_REPO: ios-branch-deep-linking-attribution
1617
steps:
18+
- name: Set tag name varibale for repository_dispatch event type
19+
if: github.event_name == 'repository_dispatch'
20+
run: |
21+
echo IOS_SDK_REPO_TAG=${{ github.event.client_payload.tag }} >> $GITHUB_ENV
22+
- name: Set tag name varibale for workflow_dispatch event type
23+
if: github.event_name == 'workflow_dispatch'
24+
run: |
25+
echo IOS_SDK_REPO_TAG=${{ github.event.inputs.tag }} >> $GITHUB_ENV
1726
- name: Check out SPM repo
1827
uses: actions/checkout@v3
1928
- name: Check out main iOS repo
2029
uses: actions/checkout@v3
2130
with:
2231
repository: ${{ env.MAIN_REPO_OWNER }}/${{ env.MAIN_REPO_REPO }}
23-
ref: ${{ github.event.client_payload.tag }}
32+
ref: ${{ env.IOS_SDK_REPO_TAG }}
2433
path: .ios-repo
2534
- name: Import release ${{ env.IOS_SDK_REPO_TAG }}
2635
id: import-release
2736
uses: ./.github/actions/import-release
2837
with:
29-
tag: ${{ github.event.client_payload.tag }}
38+
tag: ${{ env.IOS_SDK_REPO_TAG }}
3039
- name: Create release
3140
uses: actions/github-script@v4
3241
with:
3342
result-encoding: string
3443
script: |
35-
const tag = '${{ github.event.client_payload.tag }}';
44+
const tag = '${{ env.IOS_SDK_REPO_TAG }}';
3645
const sha = '${{ steps.import-release.outputs.sha }}';
3746
const mainRepoOwner = '${{ env.MAIN_REPO_OWNER }}';
3847
const mainRepoRepo = '${{ env.MAIN_REPO_REPO }}';

0 commit comments

Comments
 (0)