Skip to content

Commit 0c10fe8

Browse files
Merge branch 'master' into feature/prism-changes-php
2 parents 97c4742 + 865c3f6 commit 0c10fe8

File tree

24 files changed

+210
-23
lines changed

24 files changed

+210
-23
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: slack-alert-action
2+
description: "Action to send slack payload to public-sdk-events channel"
3+
4+
inputs:
5+
heading_text:
6+
required: true
7+
description: "Heading of the slack payload"
8+
alert_type:
9+
required: true
10+
description: "type of the slack alert"
11+
job_status:
12+
required: true
13+
description: "status of the job"
14+
XERO_SLACK_WEBHOOK_URL:
15+
required: true
16+
description: "webhook url for channel - public-sdk-events"
17+
job_url:
18+
required: true
19+
description: "job run id link"
20+
button_type:
21+
required: true
22+
description: "color for the check logs button"
23+
package_version:
24+
required: true
25+
description: "released package version"
26+
repo_link:
27+
required: true
28+
description: "link of the repo"
29+
30+
31+
runs:
32+
using: "composite"
33+
34+
steps:
35+
36+
- name: Send slack notification
37+
id: slack
38+
uses: slackapi/[email protected]
39+
env:
40+
SLACK_WEBHOOK_URL: ${{inputs.XERO_SLACK_WEBHOOK_URL}}
41+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
42+
with:
43+
payload: |
44+
{
45+
"blocks": [
46+
{
47+
"type": "rich_text",
48+
"elements": [
49+
{
50+
"type": "rich_text_section",
51+
"elements": [
52+
{
53+
"type": "text",
54+
"text": "${{inputs.heading_text}} ",
55+
"style": {
56+
"bold": true
57+
}
58+
},
59+
{
60+
"type": "emoji",
61+
"name": "${{inputs.alert_type}}"
62+
}
63+
]
64+
}
65+
]
66+
},
67+
{
68+
"type": "divider"
69+
},
70+
{
71+
"type": "section",
72+
"fields": [
73+
{
74+
"type": "mrkdwn",
75+
"text": "*Repository:* \n ${{inputs.repo_link}}"
76+
},
77+
{
78+
"type": "mrkdwn",
79+
"text": "*Status:*\n ${{inputs.job_status}}"
80+
},
81+
{
82+
"type": "mrkdwn",
83+
"text": "*Package Version:*\n ${{inputs.package_version}}"
84+
}
85+
]
86+
},
87+
{
88+
"type": "actions",
89+
"elements": [
90+
{
91+
"type": "button",
92+
"text": {
93+
"type": "plain_text",
94+
"text": "Check the logs",
95+
"emoji": true
96+
},
97+
"style": "${{inputs.button_type}}",
98+
"url": "${{inputs.job_url}}"
99+
}
100+
]
101+
}
102+
]
103+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Check Packagist Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
check-publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
13+
steps:
14+
15+
- name: Checkout repo
16+
uses: actions/checkout@v4
17+
with:
18+
repository: XeroAPI/xero-php-oauth2
19+
path: xero-php-oauth2
20+
21+
- name: Fetch Latest release number
22+
id: get_latest_release_number
23+
run: |
24+
latest_version=$(gh release view --json tagName --jq '.tagName')
25+
echo "Latest release version is - $latest_version"
26+
echo "php_version=${latest_version}" >> $GITHUB_ENV
27+
working-directory: xero-php-oauth2
28+
env:
29+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
30+
31+
- name: Get latest version from packgist
32+
id: get_packagist_version
33+
run: |
34+
RESPONSE=$(curl -s https://repo.packagist.org/p2/xeroapi/xero-php-oauth2.json)
35+
LATEST_VERSION=$(echo $RESPONSE | jq -r '.packages["xeroapi/xero-php-oauth2"][0].version')
36+
echo "latest packagist version: $LATEST_VERSION"
37+
echo "latest_packagist_version=${LATEST_VERSION}" >> $GITHUB_ENV
38+
39+
- name: Compare versions
40+
id: compare_versions
41+
run: |
42+
if [ "${{env.php_version}}" == "${{env.latest_packagist_version}}" ]; then
43+
echo "Packagist is up-to-date"
44+
echo "packagist_status=success" >> $GITHUB_ENV
45+
else
46+
echo "Packagist is not updated yet"
47+
echo "packagist_status=failure" >> $GITHUB_ENV
48+
fi
49+
50+
- name: Send slack Notification on Success
51+
if: ${{ env.packagist_status == 'success' }}
52+
uses: ./xero-php-oauth2/.github/actions/notify-slack
53+
with:
54+
heading_text: "Publish job has succeeded !"
55+
alert_type: "thumbsup"
56+
job_status: "Success"
57+
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
58+
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
59+
button_type: "primary"
60+
package_version: ${{env.php_version}}
61+
repo_link: ${{github.server_url}}/${{github.repository}}
62+
63+
- name: Send slack Notification on Failure
64+
if: ${{ env.packagist_status == 'failure' }}
65+
uses: ./xero-php-oauth2/.github/actions/notify-slack
66+
with:
67+
heading_text: "Publish job has failed !"
68+
alert_type: "alert"
69+
job_status: "Failed"
70+
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
71+
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
72+
button_type: "danger"
73+
package_version: ${{env.php_version}}
74+
repo_link: ${{github.server_url}}/${{github.repository}}
75+
76+
- name: Fail job if status is Failure
77+
if: ${{env.packagist_status == 'failure'}}
78+
run: |
79+
echo "Job failed because packagist is not updated"
80+
exit 1

docs/v2/accounting/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6338,7 +6338,7 @@
63386338
<nav id="scrollingNav">
63396339
<ul class="sidenav nav nav-list">
63406340
<li class="nav-header" data-group="Accounting"><strong>SDK: </strong><span id='sdk-name'></span></li>
6341-
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>9.1.0</li>
6341+
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>9.2.0</li>
63426342
<li class="nav-header" data-group="Accounting"><a href="#api-Accounting">Methods</a></li>
63436343
<li data-group="Accounting" data-name="createAccount" class="">
63446344
<a href="#api-Accounting-createAccount">createAccount</a>

docs/v2/appstore/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@
12401240
<nav id="scrollingNav">
12411241
<ul class="sidenav nav nav-list">
12421242
<li class="nav-header" data-group="AppStore"><strong>SDK: </strong><span id='sdk-name'></span></li>
1243-
<li class="nav-header" data-group="AppStore"><strong>VSN: </strong>9.1.0</li>
1243+
<li class="nav-header" data-group="AppStore"><strong>VSN: </strong>9.2.0</li>
12441244
<li class="nav-header" data-group="AppStore"><a href="#api-AppStore">Methods</a></li>
12451245
<li data-group="AppStore" data-name="getSubscription" class="">
12461246
<a href="#api-AppStore-getSubscription">getSubscription</a>

docs/v2/assets/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@
13891389
<nav id="scrollingNav">
13901390
<ul class="sidenav nav nav-list">
13911391
<li class="nav-header" data-group="Asset"><strong>SDK: </strong><span id='sdk-name'></span></li>
1392-
<li class="nav-header" data-group="Asset"><strong>VSN: </strong>9.1.0</li>
1392+
<li class="nav-header" data-group="Asset"><strong>VSN: </strong>9.2.0</li>
13931393
<li class="nav-header" data-group="Asset"><a href="#api-Asset">Methods</a></li>
13941394
<li data-group="Asset" data-name="createAsset" class="">
13951395
<a href="#api-Asset-createAsset">createAsset</a>

docs/v2/files/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@
11691169
<nav id="scrollingNav">
11701170
<ul class="sidenav nav nav-list">
11711171
<li class="nav-header" data-group="Files"><strong>SDK: </strong><span id='sdk-name'></span></li>
1172-
<li class="nav-header" data-group="Files"><strong>VSN: </strong>9.1.0</li>
1172+
<li class="nav-header" data-group="Files"><strong>VSN: </strong>9.2.0</li>
11731173
<li class="nav-header" data-group="Files"><a href="#api-Files">Methods</a></li>
11741174
<li data-group="Files" data-name="createFileAssociation" class="">
11751175
<a href="#api-Files-createFileAssociation">createFileAssociation</a>

docs/v2/finance/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2715,7 +2715,7 @@
27152715
<nav id="scrollingNav">
27162716
<ul class="sidenav nav nav-list">
27172717
<li class="nav-header" data-group="Finance"><strong>SDK: </strong><span id='sdk-name'></span></li>
2718-
<li class="nav-header" data-group="Finance"><strong>VSN: </strong>9.1.0</li>
2718+
<li class="nav-header" data-group="Finance"><strong>VSN: </strong>9.2.0</li>
27192719
<li class="nav-header" data-group="Finance"><a href="#api-Finance">Methods</a></li>
27202720
<li data-group="Finance" data-name="getAccountingActivityAccountUsage" class="">
27212721
<a href="#api-Finance-getAccountingActivityAccountUsage">getAccountingActivityAccountUsage</a>

docs/v2/payroll_au/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3411,7 +3411,7 @@
34113411
<nav id="scrollingNav">
34123412
<ul class="sidenav nav nav-list">
34133413
<li class="nav-header" data-group="PayrollAu"><strong>SDK: </strong><span id='sdk-name'></span></li>
3414-
<li class="nav-header" data-group="PayrollAu"><strong>VSN: </strong>9.1.0</li>
3414+
<li class="nav-header" data-group="PayrollAu"><strong>VSN: </strong>9.2.0</li>
34153415
<li class="nav-header" data-group="PayrollAu"><a href="#api-PayrollAu">Methods</a></li>
34163416
<li data-group="PayrollAu" data-name="approveLeaveApplication" class="">
34173417
<a href="#api-PayrollAu-approveLeaveApplication">approveLeaveApplication</a>

docs/v2/payroll_nz/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4086,7 +4086,7 @@
40864086
<nav id="scrollingNav">
40874087
<ul class="sidenav nav nav-list">
40884088
<li class="nav-header" data-group="PayrollNz"><strong>SDK: </strong><span id='sdk-name'></span></li>
4089-
<li class="nav-header" data-group="PayrollNz"><strong>VSN: </strong>9.1.0</li>
4089+
<li class="nav-header" data-group="PayrollNz"><strong>VSN: </strong>9.2.0</li>
40904090
<li class="nav-header" data-group="PayrollNz"><a href="#api-PayrollNz">Methods</a></li>
40914091
<li data-group="PayrollNz" data-name="approveTimesheet" class="">
40924092
<a href="#api-PayrollNz-approveTimesheet">approveTimesheet</a>

docs/v2/payroll_uk/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@
19541954
"leaveType" : {
19551955
"type" : "string",
19561956
"description" : "The type of statutory leave",
1957-
"enum" : [ "Sick", "Adoption", "Maternity", "Paternity", "Sharedparental" ]
1957+
"enum" : [ "Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement" ]
19581958
},
19591959
"balanceRemaining" : {
19601960
"type" : "number",
@@ -2002,7 +2002,7 @@
20022002
"type" : {
20032003
"type" : "string",
20042004
"description" : "The category of statutory leave",
2005-
"enum" : [ "Sick", "Adoption", "Maternity", "Paternity", "Sharedparental" ]
2005+
"enum" : [ "Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement" ]
20062006
},
20072007
"startDate" : {
20082008
"type" : "string",
@@ -3599,7 +3599,7 @@
35993599
<nav id="scrollingNav">
36003600
<ul class="sidenav nav nav-list">
36013601
<li class="nav-header" data-group="PayrollUk"><strong>SDK: </strong><span id='sdk-name'></span></li>
3602-
<li class="nav-header" data-group="PayrollUk"><strong>VSN: </strong>9.1.0</li>
3602+
<li class="nav-header" data-group="PayrollUk"><strong>VSN: </strong>9.2.0</li>
36033603
<li class="nav-header" data-group="PayrollUk"><a href="#api-PayrollUk">Methods</a></li>
36043604
<li data-group="PayrollUk" data-name="approveTimesheet" class="">
36053605
<a href="#api-PayrollUk-approveTimesheet">approveTimesheet</a>

0 commit comments

Comments
 (0)