Compare commits
25 Commits
v0.0.2
...
env-variables
| Author | SHA1 | Date | |
|---|---|---|---|
| 264c4c008d | |||
| 6e93d2526a | |||
| 5f49386817 | |||
| cdf7368cc8 | |||
| eeee33e584 | |||
| a8108f8532 | |||
| 57082ee51f | |||
| 5dd225a0cc | |||
| b3d32d4c2b | |||
| a57fcabf73 | |||
| 7ed3e250df | |||
| 453a0856d6 | |||
| 90cf5a2fe8 | |||
| 27e65856d5 | |||
| 8457214b63 | |||
| d0c8ef4632 | |||
| 6a758bf3f0 | |||
| 119adfd57b | |||
| e651cd4edc | |||
| 2f0807172e | |||
| 58d5eaad1c | |||
| 497b2b5ea9 | |||
| 44dc459b7f | |||
| c6d699713f | |||
| 1a17b82888 |
+12
-10
@@ -2,20 +2,22 @@ name: RCON Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches: [ env-variables ]
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
DAY_OF_WEEK: Monday
|
||||
|
||||
jobs:
|
||||
hello_world_job:
|
||||
rcon_test:
|
||||
runs-on: ubuntu-latest
|
||||
name: A job to say hello
|
||||
name: RCON Test Dev
|
||||
steps:
|
||||
- name: Hello world action step
|
||||
id: hello
|
||||
uses: Plagiatus/RCON-Action@v0.0.2
|
||||
- name: RCON Connection
|
||||
uses: Plagiatus/RCON-Action@v0.2
|
||||
with:
|
||||
who-to-greet: 'Mona the Octocat'
|
||||
# Use the output from the `hello` step
|
||||
- name: Get the output time
|
||||
run: echo "The time was ${{ steps.hello.outputs.time }}"
|
||||
server: ${{ secrets.rcon_server }}
|
||||
port: ${{ secrets.rcon_port }}
|
||||
password: ${{ secrets.rcon_password }}
|
||||
commands: '["tellraw @a [{\"text\":\"${{env.DAY_OF_WEEK}}\"}]", "say ref: ${{ github.ref }}", "say ip ${{ secrets.rcon_server }}", "say actor ${{ github.actor }}", "reload"]'
|
||||
|
||||
+21
@@ -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.
|
||||
@@ -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
|
||||
+11
-7
@@ -1,27 +1,31 @@
|
||||
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
|
||||
send-push-info:
|
||||
required: false
|
||||
description: Sends information about the push to the server as a tellraw
|
||||
description: Sends information about the push to the server as a tellraw
|
||||
default: true
|
||||
push-info-recipient:
|
||||
required: false
|
||||
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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -14,28 +14,27 @@ async function run() {
|
||||
server: core.getInput("server"),
|
||||
port: core.getInput("port"),
|
||||
password: core.getInput("password"),
|
||||
commands: core.getInput("commands"),
|
||||
commands: JSON.parse(core.getInput("commands")),
|
||||
sendPushInfo: core.getInput("send-push-info"),
|
||||
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();
|
||||
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user