21 Commits

Author SHA1 Message Date
Plagiatus 264c4c008d single-escape? 2022-11-27 17:18:08 +02:00
Lukas Scheuerle 6e93d2526a try escaping again 2022-11-25 19:02:25 +02:00
Lukas Scheuerle 5f49386817 attempt Json text escape 2022-11-25 18:46:23 +02:00
Lukas Scheuerle cdf7368cc8 Update main.yml 2022-11-23 13:02:44 +02:00
Lukas Scheuerle eeee33e584 Update main.yml 2022-11-23 13:01:35 +02:00
Lukas Scheuerle a8108f8532 Update main.yml 2022-11-23 13:00:33 +02:00
Lukas Scheuerle 57082ee51f Update main.yml 2022-11-23 12:56:45 +02:00
Lukas Scheuerle 5dd225a0cc Update main.yml 2022-11-23 12:55:02 +02:00
Lukas Scheuerle b3d32d4c2b Update main.yml 2022-11-23 12:54:12 +02:00
Lukas Scheuerle a57fcabf73 update to node 16 2022-11-23 10:41:45 +02:00
Lukas Scheuerle 7ed3e250df Update main.yml 2022-11-22 15:51:54 +02:00
Lukas Scheuerle 453a0856d6 update branding 2021-11-22 12:29:20 +02:00
Lukas Scheuerle 90cf5a2fe8 clarify it's about minecraft 2021-11-22 12:10:28 +02:00
Lukas Scheuerle 27e65856d5 add icon and color 2021-11-22 12:09:19 +02:00
Lukas Scheuerle 8457214b63 add LICENSE 2021-11-22 12:00:55 +02:00
Lukas Scheuerle d0c8ef4632 Create LICENSE 2021-11-22 11:32:36 +02:00
Lukas Scheuerle (Plagiatus) 6a758bf3f0 add credits to readme 2021-03-16 12:32:55 +01:00
Lukas Scheuerle 119adfd57b Create README.md 2021-03-16 01:37:56 +01:00
Lukas Scheuerle e651cd4edc Update README.md 2021-03-16 01:37:27 +01:00
Lukas Scheuerle 2f0807172e update readme to include a small bit of instructions. 2021-03-16 01:26:39 +01:00
Lukas Scheuerle (Plagiatus) 58d5eaad1c update to v0.1, including readme 2021-03-16 01:09:34 +01:00
6 changed files with 117 additions and 19 deletions
+8 -5
View File
@@ -2,19 +2,22 @@ name: RCON Test
on:
push:
branches: [ main ]
branches: [ env-variables ]
workflow_dispatch:
env:
DAY_OF_WEEK: Monday
jobs:
rcon_test:
runs-on: ubuntu-latest
name: RCON Test
name: RCON Test Dev
steps:
- name:
uses: Plagiatus/RCON-Action@v0.0.3
- name: RCON Connection
uses: Plagiatus/RCON-Action@v0.2
with:
server: ${{ secrets.rcon_server }}
port: ${{ secrets.rcon_port }}
password: ${{ secrets.rcon_password }}
commands: '["say hi", "reload"]'
commands: '["tellraw @a [{\"text\":\"${{env.DAY_OF_WEEK}}\"}]", "say ref: ${{ github.ref }}", "say ip ${{ secrets.rcon_server }}", "say actor ${{ github.actor }}", "reload"]'
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Lukas Scheuerle
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+51 -1
View File
@@ -1,3 +1,53 @@
# RCON-Action
Integrate RCON actions into your github workflow
Integrate RCON actions into your github workflow.
Originally created and intended to be used for a more automated use of minecraft datapacks, in tandem with the [FTP Deploy](https://github.com/marketplace/actions/ftp-deploy) action. See [this file](https://github.com/Plagiatus/YeggsMapjam2021/blob/main/.github/workflows/main.yml) for a working example of a combination of these two.
To set up with your Minecraft Server via FTP, copy the [linked example file](https://github.com/Plagiatus/YeggsMapjam2021/blob/main/.github/workflows/main.yml) to `your_repository/.github/workflow/main.yml`, update and add the [secrets](https://docs.github.com/en/actions/reference/encrypted-secrets) to your repository and you're ready to go. That is if your server has both FTP and RCON enabled.
## Example Action File
[File in this repository](https://github.com/Plagiatus/RCON-Action/blob/main/.github/workflows/main.yml)
```yml
name: RCON Test
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
rcon_test:
runs-on: ubuntu-latest
name: RCON Test
steps:
- name: RCON Connection
uses: Plagiatus/RCON-Action@v0.1
with:
server: ${{ secrets.rcon_server }}
port: ${{ secrets.rcon_port }}
password: ${{ secrets.rcon_password }}
commands: '["say hi", "reload"]'
```
## Available Arguments
| name | required | description | default | example |
|-|-|-|-|-|
| server | yes | The server IP | | `127.0.0.1` |
| port | no | The RCON port | `25575` | `12345` |
| password | no | The password | `""` | `Sj3%ka"l` |
| commands | no | Additional commands you want to run, in the form of a JSON String Array | | `'["say hi", "reload"]'` |
| send-push-info | no | Whether a tellraw informing about the push should be sent | `true` | |
| push-info-recipient | no | Changes the selector of the push info tellraw. | `@a` | `@a[tag=admin]` |
It is highly recommended to use [github secrets](https://docs.github.com/en/actions/reference/encrypted-secrets) instead of plaintext inclusions for more sensitive data like the IP or the password.
## Credits
- Node-RCON taken from https://github.com/tehbeard/node-rcon by @tehbeard.
- RCON-Action made by @Plagiatus
+10 -6
View File
@@ -1,16 +1,17 @@
name: Send RCON commands
description: Send command(s) via RCON connection to a RCON server
name: Send RCON commands to minecraft server
description: Send command(s) via RCON connection to a RCON enabled minecraft server
inputs:
server:
required: true
description: The server IP address
port:
required: true
required: false
description: The server's RCON port
default: 25575
password:
required: true
required: false
description: The RCON password to authenticate
default: ""
commands:
required: true
description: Additional commands to send
@@ -23,5 +24,8 @@ inputs:
description: Changes the selector of who should be getting the server info.
default: "@a"
runs:
using: node12
main: index.js
using: node16
main: index.js
branding:
icon: arrow-right-circle
color: green
+6 -7
View File
@@ -4,7 +4,7 @@ const rcon = require( "./node-rcon/RCON.js" );
run()
async function run() {
console.log("❤ thank you for using RCON-Action (https://github.com/Plagiatus/RCON-Action).");
console.log("💚 thank you for using RCON-Action ( https://github.com/Plagiatus/RCON-Action ).");
console.log("⭐ if you find this helpful, why not drop a star on the repo? Much appreciated!");
console.log("❓ if you have any questions or issues, please let us know by writing an issue");
@@ -19,23 +19,22 @@ async function run() {
pushInfoRecipient: core.getInput("push-info-recipient"),
}
const payload = JSON.stringify(github.context.payload, undefined, 2);
console.log(inputs);
console.log(payload);
// console.log(inputs);
// console.log(payload);
const srvr = new rcon();
console.log("Connecting to server via RCON...");
await srvr.connect(inputs.server, inputs.port, inputs.password)
console.log("🟢 connected and authenticated");
console.log("🟢 Connected and authenticated.");
if (inputs.sendPushInfo) {
await srvr.send(`tellraw ${inputs.pushInfoRecipient} [{"text":"[GitHub] New push from ","color":"#6D0599"},{"text":"${github.context.payload.sender.login}","color":"#330080"},{"text":" detected and added to the server via ftp."}]`)
await srvr.send(`tellraw ${inputs.pushInfoRecipient} [{"text":"[GitHub] New push from ","color":"gold"},{"text":"${github.context.payload.sender.login}","color":"yellow"},{"text":" detected."}]`)
}
if (inputs.commands.length > 0) {
for (let command of inputs.commands) {
await srvr.send(command);
}
console.log(`📬 Sent all ${inputs.commands.length} to the server.`)
console.log(`📬 Sent all ${inputs.commands.length} additional commands to the server.`)
}
srvr.end();
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Tehbeard
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.