diff --git a/README.md b/README.md index 894c157..aa421c8 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,15 @@ jobs: CCI_TOKEN: ${{ secrets.CCI_TOKEN }} ``` +# Outputs + +Field | Data Type | Description +-- | -- | -- +`id` | string (uuid) | The unique ID of the pipeline. +`state` | string (Enum: "created" "errored" "setup-pending" "setup" "pending") | The current state of the pipeline. +`number` | integer (int64) | The number of the pipeline. +`created_at` | string (date-time) | The date and time the pipeline was created. + # Things To Know ## GitHub Actions runs _alongside_ native CircleCI integration. diff --git a/action.yml b/action.yml index 6be1af8..b966db6 100644 --- a/action.yml +++ b/action.yml @@ -7,6 +7,15 @@ inputs: GHA_Meta: required: false description: 'An optional additional metadata parameter. Will be available on the CircleCI pipeline as GHA_Meta' +outputs: + id: + description: The unique ID of the pipeline. + state: + description: The current state of the pipeline. + number: + description: The number of the pipeline. + created_at: + description: The date and time the pipeline was created. runs: using: 'node16' main: 'dist/index.js' diff --git a/dist/index.js b/dist/index.js index 96940b3..796934a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -16558,6 +16558,10 @@ axios__WEBPACK_IMPORTED_MODULE_2___default().post(url, body, { headers: headers .then((response) => { (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.startGroup)("Successfully triggered CircleCI Pipeline"); (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.info)(`CircleCI API Response: ${JSON.stringify(response.data)}`); + (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput)("created_at", response.data.created_at); + (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput)("id", response.data.id); + (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput)("number", response.data.number); + (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.setOutput)("state", response.data.state); (0,_actions_core__WEBPACK_IMPORTED_MODULE_0__.endGroup)(); }) .catch((error) => { diff --git a/index.js b/index.js index 9a44648..5918b85 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ import { getInput, setFailed, + setOutput, startGroup, endGroup, info, @@ -81,6 +82,10 @@ axios .then((response) => { startGroup("Successfully triggered CircleCI Pipeline"); info(`CircleCI API Response: ${JSON.stringify(response.data)}`); + setOutput("created_at", response.data.created_at); + setOutput("id", response.data.id); + setOutput("number", response.data.number); + setOutput("state", response.data.state); endGroup(); }) .catch((error) => {