Skip to content

Commit 3f0c7e1

Browse files
committed
Add extension to subscription cron
Signed-off-by: Stefan Sauterleute <stefan.sauterleute@byteleaf.de>
1 parent 6477e86 commit 3f0c7e1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ This GitHub Action allows you to interact with IBM Cloud Code Engine. Deploy App
2121
| `destination-type` || app | The type of the destination. Valid values are `app`, `function` and `job`. This value is optional. |
2222
| `destination` || - | The name of the application or job resource that you want to receive events; for example, `myapp`. If needed, use the --path option to further qualify an app destination. This value is required. |
2323
| `path` || - | The path within the destination application where events are forwarded; for example, `/events`. |
24+
| `extension` || - | Extension used for the Subscription. Set CloudEvents extensions to send to the destination. Must be in `NAME=VALUE` format. This action adds a new CloudEvents extension or overrides an existing CloudEvent attribute. Specify one extension per --extension option; for example, `--ext extA=A --ext extB=B`. |
2425
| `schedule` || - | Schedule how often the event is triggered, in crontab format. For example, specify `'*/2 * * * *'` (in string format) for every two minutes. By default, the cron event is triggered every minute and is set to the `UTC` time zone. |
2526

2627
## Usage and Example

action.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,15 @@ inputs:
5050
required: false
5151

5252
path:
53-
description: Path used for the Subscription only required for subscription
53+
description: Path used for the Subscription. For example, /events
54+
required: false
55+
56+
extension:
57+
description: Extension used for the Subscription. Set CloudEvents extensions to send to the destination. Must be in 'NAME=VALUE' format. This action adds a new CloudEvents extension or overrides an existing CloudEvent attribute. Specify one extension per --extension option; for example, --ext extA=A --ext extB=B.
5458
required: false
5559

5660
schedule:
57-
description: Schedule used for the Subscription only required for subscription. For example, specify '*/2 * * * *' (in string format) for every two minutes
61+
description: Schedule used for the Subscription. For example, specify '*/2 * * * *' (in string format) for every two minutes
5862
required: false
5963

6064
build-source:
@@ -177,9 +181,9 @@ runs:
177181
if: ( inputs.component == 'subscription' || inputs.component == 'sub' ) && inputs.subscription-type == 'cron'
178182
run: |
179183
if ibmcloud ce sub cron get --name ${{ inputs.name }} ; then
180-
ibmcloud ce sub cron update --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --schedule ${{ inputs.schedule }} --wait ${{ steps.set-resources.outputs.cpu }} ${{ steps.set-resources.outputs.memory }}
184+
ibmcloud ce sub cron update --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --extension ${{ inputs.extension }} --schedule ${{ inputs.schedule }} --wait ${{ steps.set-resources.outputs.cpu }} ${{ steps.set-resources.outputs.memory }}
181185
else
182-
ibmcloud ce sub cron create --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --schedule ${{ inputs.schedule }} --wait ${{ steps.set-resources.outputs.cpu }} ${{ steps.set-resources.outputs.memory }}
186+
ibmcloud ce sub cron create --name ${{ inputs.name }} --destination-type ${{ inputs.destination-type }} --destination ${{ inputs.destination }} --path ${{ inputs.path }} --extension ${{ inputs.extension }} --schedule ${{ inputs.schedule }} --wait ${{ steps.set-resources.outputs.cpu }} ${{ steps.set-resources.outputs.memory }}
183187
fi
184188
185189
- name: Get component

0 commit comments

Comments
 (0)