Skip to content

Commit 7314f60

Browse files
committed
Add GitHub Updater integration for automatic plugin updates
1 parent 25bd557 commit 7314f60

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
workflow_dispatch:
6+
inputs:
7+
version:
8+
description: 'Version number to tag (e.g., 1.2.3)'
9+
required: true
10+
type: string
11+
12+
jobs:
13+
update-readme-stable-tag:
14+
runs-on: ubuntu-latest
15+
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@v4
19+
20+
- name: Extract version from readme.txt
21+
id: extract_version
22+
run: |
23+
VERSION=$(grep -E '^Stable tag:' readme.txt | awk '{print $3}')
24+
echo "version=$VERSION" >> $GITHUB_OUTPUT
25+
26+
- name: Check if tag already exists
27+
id: check_tag
28+
run: |
29+
VERSION=${{ steps.extract_version.outputs.version }}
30+
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
31+
echo "Tag v$VERSION already exists."
32+
echo "tag_exists=true" >> $GITHUB_OUTPUT
33+
else
34+
echo "tag_exists=false" >> $GITHUB_OUTPUT
35+
fi
36+
37+
- name: Tag new version
38+
if: github.event_name != 'workflow_dispatch' && steps.check_tag.outputs.tag_exists == 'false'
39+
run: |
40+
VERSION=${{ steps.extract_version.outputs.version }}
41+
git config user.name "github-actions[bot]"
42+
git config user.email "github-actions[bot]@users.noreply.github.com"
43+
git tag "v$VERSION"
44+
git push origin "v$VERSION"

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
- Webhook URL (from your Google Apps Script Web App)
1818
- Secret Key (must match the script's `AUTH_SECRET`)
1919
- Enable/Disable toggle
20+
4. (Optional) To enable automatic updates from GitHub:
21+
- Install the [GitHub Updater plugin](https://github.com/afragen/github-updater).
22+
- This plugin includes the required GitHub header and will notify you when updates are available.
2023

2124
## Google Apps Script Setup
2225

@@ -47,3 +50,8 @@ Only requests with the correct secret key (header or query param) will be accept
4750
## License
4851

4952
GPLv2 or later
53+
54+
## Updating the Plugin
55+
56+
To receive automatic updates for WebHookARM directly from GitHub, install the [GitHub Updater plugin](https://github.com/afragen/github-updater).
57+
It will check for updates and allow one-click updates from your WordPress dashboard.

readme.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ A lightweight WordPress plugin that listens for ARMember profile update events a
2020
- **Secret Key**: Must match `AUTH_SECRET` (Apps Script) or your endpoint config.
2121
- **Enable Webhook**: Toggle on/off.
2222

23+
5. (Optional) To enable automatic updates from GitHub:
24+
- Install the <a href="https://github.com/afragen/github-updater" target="_blank">GitHub Updater plugin</a>.
25+
- Make sure this plugin includes the line "GitHub Plugin URI" in its header (already included).
26+
- Updates will now appear like any other plugin in your WordPress dashboard.
27+
2328
== Configuration ==
2429

2530
For Google Apps Script:
@@ -46,6 +51,10 @@ No. This plugin specifically hooks into ARMember's `arm_update_profile_external`
4651
Create a sheet tab matching `SHEET_NAME` and add a header row with:
4752
| Timestamp | User ID | User Login | User Email | Raw JSON Payload |
4853

54+
= How do I enable automatic updates? =
55+
Install the GitHub Updater plugin (https://github.com/afragen/github-updater) to receive plugin updates directly from GitHub.
56+
Once installed, it will automatically check for new versions of WebHookARM and allow one-click updates from your WordPress dashboard.
57+
4958
= How do I get support? =
5059
Open an issue at https://github.com/renatobo/WebHookARM or contact Renato Bonomini.
5160

webhookarm.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ function bono_arm_webhook_settings_page() {
100100
Use a secure Web App URL and secret key (configured in Apps Script properties or in Make.com HTTP module).<br />
101101
<strong>Version:</strong> <?php echo BONO_ARM_WEBHOOK_VERSION; ?>
102102
</p>
103+
<p>
104+
<strong>Updates:</strong> To enable automatic updates for this plugin via GitHub, please install the
105+
<a href="https://github.com/afragen/github-updater" target="_blank" rel="noopener noreferrer">GitHub Updater</a> plugin.
106+
</p>
103107
<form method="post" action="options.php">
104108
<?php
105109
settings_fields('bono_arm_webhook');
@@ -142,6 +146,9 @@ function bono_arm_webhook_settings_page() {
142146
Author: Renato Bonomini
143147
</a>
144148
</p>
149+
<p>
150+
💫 If you find this plugin useful, please consider <a href="https://github.com/renatobo/WebHookARM/stargazers" target="_blank" rel="noopener noreferrer">starring the repository on GitHub</a>!
151+
</p>
145152
<p>
146153
Example Google Apps Script:
147154
<a href="<?php echo esc_url(content_url('plugins/WebHookARM/webhookarm_appscript.gs')); ?>"

0 commit comments

Comments
 (0)