-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (44 loc) · 1.29 KB
/
Copy pathpublish-common-trigger.yml
File metadata and controls
49 lines (44 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: 2. SDK publish RC manual or from master/support
on:
workflow_dispatch:
pull_request:
types: [closed]
branches:
- 'master'
- 'support/*'
permissions:
contents: read
jobs:
check-branch-for-manual:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Check if branch matches pattern
env:
REF_NAME: ${{ github.ref_name }}
run: |
if ! echo "$REF_NAME" | grep -q "release/.*-rc"; then
echo "Branch name must match pattern 'release/*-rc'"
exit 1
fi
publish-manual:
if: github.event_name == 'workflow_dispatch'
needs: check-branch-for-manual
permissions:
contents: write
id-token: write
uses: ./.github/workflows/publish-reusable.yml
with:
branch: ${{ github.ref_name }}
secrets:
PAT_FOR_TRIGGERING_BRANCH_PROTECTION: ${{ secrets.PAT_FOR_TRIGGERING_BRANCH_PROTECTION }}
publish-from-pr:
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
permissions:
contents: write
id-token: write
uses: ./.github/workflows/publish-reusable.yml
with:
branch: ${{ github.base_ref }}
secrets:
PAT_FOR_TRIGGERING_BRANCH_PROTECTION: ${{ secrets.PAT_FOR_TRIGGERING_BRANCH_PROTECTION }}