Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

What is the HTTP/S Connector?

A connector in PIPEFORCE is one or more commands allowing you to connect to external systems and exchange data with them.

The HTTP/S Connector allows to connect to such external systems using the HTTP/S protocol. For example if you would like to make RESTful calls.

Typically such endpoints are secured with username and password or a token. You should never place such sensitive data into your source code. Instead, create a new Secrets and refer to it in your pipeline.

Here is an example to access the GitHub API using the command http.get and a custom secret, created before:

pipeline:
  - http.get:
      url: "https://api.github.com/owner/repo/actions/artifacts"
      secret: "github-secret"

This will return a JSON document like this example, which can be used in the pipeline for further processing:

{
  "total_count": 1,
  "artifacts": [
    {
      "id": 11,
      "node_id": "MDg6QXJ0bbZhY3QxMQ==",
      "name": "Rails",
      "size_in_bytes": 556,
      "url": "https://api.github.com/repos/owner/repo/actions/artifacts/11",
      "archive_download_url": "https://api.github.com/repos/owner/repo/actions/artifacts/11/zip",
      "expired": false,
      "created_at": "2022-01-10T14:59:22Z",
      "expires_at": "2022-03-21T14:59:22Z",
      "updated_at": "2022-02-21T14:59:22Z",
      "workflow_run": {
        "id": 2332928,
        "repository_id": 1296569,
        "head_repository_id": 1296219,
        "head_branch": "main",
        "head_sha": "328faa0536e6fef19903d9d91dc96a9931694ce3"
      }
    }
  ]
}

Also see these connector commands:

  • No labels