From 66350bec3af20b9ceb67c88221f7fba90886a8ac Mon Sep 17 00:00:00 2001 From: Kyle Van Berendonck Date: Sat, 7 Oct 2023 18:04:09 +1100 Subject: [PATCH] Working commit --- .editorconfig | 14 +++++++++++ .github/workflows/test-windows-latest.yml | 14 +++++++++++ .gitignore | 1 + AUTHORS | 1 + LICENSE | 2 +- action.yml | 29 +++++++++++++++++++++++ 6 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/test-windows-latest.yml create mode 100644 .gitignore create mode 100644 AUTHORS create mode 100644 action.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c3988be --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false # needed for
-like breaks diff --git a/.github/workflows/test-windows-latest.yml b/.github/workflows/test-windows-latest.yml new file mode 100644 index 0000000..5d73031 --- /dev/null +++ b/.github/workflows/test-windows-latest.yml @@ -0,0 +1,14 @@ +on: [push] +name: test-windows-latest +jobs: + test-action: + name: Test + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - uses: / + with: + uri: https://google.com/ + filename: google.html + retries: 3 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..ba76ec5 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Kyle Van Berendonck diff --git a/LICENSE b/LICENSE index dbadc12..96df03d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Cuedo Controls +Copyright (c) 2023 CUEDO CONTROLS PTY LTD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..bd39417 --- /dev/null +++ b/action.yml @@ -0,0 +1,29 @@ +name: 'Invoke URI' +description: 'Call a URI and return the result' +author: foss@cuedo.com.au +branding: + icon: 'link-2' + color: 'orange' +inputs: + uri: + required: true + description: "Invoke the specified URI" + filename: + description: "Save the output to the specified file" + retries: + description: "Retry the request if it fails" + default: 3 +runs: + using: "composite" + steps: + - name: Invoke URI (Linux) + run: export DISPLAY="127.0.0.1:10.0" + if: runner.os == 'Linux' + - name: Invoke URI (Windows) + env: + URI: ${{ format('-Uri {0}', inputs.uri) }} + FILENAME: ${{ inputs.filename > 0 && format(' -OutFile "{0}"') || '' }} + RETRIES: ${{ inputs.retries > 0 && format(' -MaximumRetryCount {0}', inputs.retries) || '' }} + run: | + Invoke-WebRequest ${{env.URI}}${{env.FILENAME}}${{env.RETRIES}} + if: runner.os == 'Windows' \ No newline at end of file