1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
sap-jenkins-library/resources/metadata/githubstatus.yaml
Oliver Nocon 5856e35d50
Add step to set GitHub status (#2012)
* add step for GitHub branch protection check

* add command to piper command

* remove unnecessary parameter

* Update resources/metadata/githubbranchprotection.yaml

* Add step to set GitHub status

* add groovy part

* update generation & go mod tidy

* update groovy tests

* update github api to fix bug

* add comment

* go mod tidy

* update naming

* update docs

* update docs

* Update resources/metadata/githubstatus.yaml

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Update resources/metadata/githubstatus.yaml

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* Update resources/metadata/githubstatus.yaml

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* update generated files

* update GitHub step order

* Update interface usage

* do not export interfaces

* go mod tidy

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-09-14 18:08:24 +02:00

111 lines
3.0 KiB
YAML

metadata:
name: githubSetCommitStatus
description: Set a status of a certain commit.
longDescription: |
This step allows you to set a status for a certain commit.
Details can be found here: https://developer.github.com/v3/repos/statuses/.
Typically, following information is set:
* state (pending, failure, success)
* context
* target URL (link to details)
It can for example be used to create additional check indicators for a pull request which can be evaluated and also be enforced by GitHub configuration.
spec:
inputs:
secrets:
- name: githubTokenCredentialsId
description: Jenkins 'Secret text' credentials ID containing token to authenticate to GitHub.
type: jenkins
params:
- name: apiUrl
aliases:
- name: githubApiUrl
description: Set the GitHub API URL.
scope:
- GENERAL
- PARAMETERS
- STAGES
- STEPS
type: string
default: https://api.github.com
mandatory: true
- name: commitId
description: The commitId for which the status should be set.
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
mandatory: true
- name: context
description: Label for the status which will for example show up in a pull request.
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
mandatory: true
- name: description
description: Short description of the status.
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
- name: owner
aliases:
- name: githubOrg
description: Name of the GitHub organization.
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
mandatory: true
- name: repository
aliases:
- name: githubRepo
description: Name of the GitHub repository.
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
mandatory: true
- name: status
description: Status which should be set on the commitId.
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
possibleValues:
- failure
- pending
- success
mandatory: true
- name: targetUrl
description: Target URL to associate the status with.
scope:
- PARAMETERS
- STAGES
- STEPS
type: string
- name: token
aliases:
- name: githubToken
description: GitHub personal access token as per https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line.
scope:
- GENERAL
- PARAMETERS
- STAGES
- STEPS
type: string
mandatory: true
secret: true
resourceRef:
- name: githubTokenCredentialsId
type: secret