From 955c0f29c2a048775e79663e915131249b096595 Mon Sep 17 00:00:00 2001 From: Nuno Aguiar Date: Sun, 21 May 2023 06:01:23 +0100 Subject: [PATCH] Update README.md --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/README.md b/README.md index 5d3a906..605fd5e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,65 @@ # ojob-action OpenAF's oJob GitHub action + +## Usage + +### Example of a GitHub action to run an ojob.io job: + +````yaml +on: [push] + +jobs: + Test: + runs-on: ubuntu-latest + name: Get env variables + steps: + - uses: actions/checkout@v3 + - uses: nmaguiar/myOJobs@nightly + with: + ojob: 'ojob.io/envs' +```` + +### Example of a GitHub action to run an ojob.io job with arguments: + +````yaml +on: [push] + +jobs: + Test: + runs-on: ubuntu-latest + name: Echo arguments + steps: + - uses: actions/checkout@v3 + - uses: nmaguiar/myOJobs@nightly + with: + ojob: 'ojob.io/echo' + args: 'abc=123 xyz=abc' +```` + +### Example of a GitHub action to retrieve the installed version and distribution of OpenAF: + +````yaml +on: [push] + +jobs: + Test: + runs-on: ubuntu-latest + name: Get version + steps: + - uses: actions/checkout@v3 + - run : | + cat < getVersion.yaml + todo: + - check version + + jobs: + - name: check version + exec: | + var data = { version: getVersion(), distribution: getDistribution() } + ow.oJob.output(data, args) + EOF + - uses: openaf/ojob-action@v1 + with: + ojob: 'getVersion.yaml' + dist: 'nightly' +````