Skip to content

Commit a70fa42

Browse files
committed
feat: Added progress_url variable, docs.
1 parent 702bdf5 commit a70fa42

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ It provides information about the repository, branch, initiator, and optionally,
1212
- `initiator`: The user who initiated the deployment.
1313
- `teams_webhook_url`: The URL of the Teams Webhook.
1414
- `message`: Message to display in the notification.
15+
- `progress_url`: URL to view the action progress.
1516

1617
### Optional
1718
- `deployment_url`: The URL of the deployment (if available).
@@ -46,17 +47,19 @@ jobs:
4647
branch_name: ${{ github.ref_name }}
4748
initiator: ${{ github.actor }}
4849
teams_webhook_url: ${{ secrets.TEAMS_WEBHOOK_URL }}
49-
message: "Deploying new app!"
50+
message: "Deploying new version of"
51+
progress_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
5052
deployment_url: https://your-deployment-url.com # Optional
5153
```
5254
5355
## How it works
5456
55-
1. The action takes in the required inputs: repository name, branch name, initiator, Teams webhook URL, and the custom message.
57+
1. The action takes in the required inputs: repository name, branch name, initiator, Teams webhook URL, custom message, and progress URL.
5658
2. It creates an Adaptive Card message with the deployment information, using the provided message.
57-
3. If a deployment URL is provided, it adds a "View Site" button to the card.
58-
4. The message is sent to the specified Teams channel using the webhook URL.
59-
5. The HTTP response from the Teams API is set as an output, which can be used in subsequent steps if needed.
59+
3. The card includes a "View Progress" button that links to the action's progress URL.
60+
4. If a deployment URL is provided, it adds a "View Site" button to the card.
61+
5. The message is sent to the specified Teams channel using the webhook URL.
62+
6. The HTTP response from the Teams API is set as an output, which can be used in subsequent steps if needed.
6063
6164
## Note
6265

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ inputs:
2020
message:
2121
description: 'Message to display in the notification.'
2222
required: true
23+
progress_url:
24+
description: 'URL to view the action progress.'
25+
required: true
2326
outputs:
2427
http_response:
2528
description: 'The HTTP response from the Teams Webhook'
@@ -33,3 +36,4 @@ runs:
3336
DEPLOYMENT_URL: ${{ inputs.deployment_url }}
3437
TEAMS_WEBHOOK_URL: ${{ inputs.teams_webhook_url }}
3538
MESSAGE: ${{ inputs.message }}
39+
PROGRESS_URL: ${{ inputs.progress_url }}

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ json_payload=$(cat << EOF
4040
{
4141
"type": "Action.OpenUrl",
4242
"title": "View Progress",
43-
"url": "https://www.example.com"
43+
"url": "${PROGRESS_URL}"
4444
}
4545
$([ -n "${DEPLOYMENT_URL}" ] && echo ',
4646
{

0 commit comments

Comments
 (0)