-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
51 lines (45 loc) · 1.87 KB
/
action.yml
File metadata and controls
51 lines (45 loc) · 1.87 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
50
51
name: OZI Publish
description: "OZI publish action."
branding:
icon: 'gift'
color: 'yellow'
inputs:
github-token:
description: "GitHub workflow-generated token."
required: false
default: ${{ github.token }}
create-pull-request:
description: "Create a pull request on the default branch."
default: false
pull-request-body:
description: "Text to use for the pull request body."
default: "Created automatically. Manually close and reopen to enable checks."
runs:
using: "composite"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
- name: Move artifact
run: cp -a artifact/. ./
shell: bash
- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/publish-action@310a9983a0ae878b29f3aac778d7c77c1db27378
with:
github_token: ${{ inputs.github-token }}
- name: Get HEAD branch name
id: head
if: ${{ fromJSON(inputs.create-pull-request) == true }}
run: git remote show origin | grep 'HEAD branch' | cut -d ":" -f2 | sed 's/ /name=/' >> $GITHUB_OUTPUT
shell: bash
- if: ${{ fromJSON(inputs.create-pull-request) == true && steps.head.outputs.name == github.ref_name }}
run: echo 'already in HEAD branch no pull request will be created'
shell: bash
- name: Create pull request
if: ${{ fromJSON(inputs.create-pull-request) == true && steps.head.outputs.name != github.ref_name }}
run: gh pr create -B $HEAD_BRANCH -H $REF_NAME --title "Merge $REF_NAME into $HEAD_BRANCH" --body "$PR_BODY"
env:
HEAD_BRANCH: ${{ steps.head.outputs.name }}
REF_NAME: ${{ github.head_ref || github.ref_name }}
PR_BODY: ${{ inputs.pull-request-body }}
GITHUB_TOKEN: ${{ inputs.github-token }}
shell: bash