-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
46 lines (44 loc) · 1.75 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Requirements
#
# Required variables:
#
# TIDELIFT_API_KEY must be a GitLab CI variable set to your Tidelift API key.
#
# Note: Your Tidelift API key can be used to perform operations in Tidelift,
# and should not be exposed to untrusted users. See
# https://docs.gitlab.com/ee/ci/variables/#cicd-variable-security for
# options for securing environment variables.
#
# Optional variables if you do not want to pre-create projects in Tidelift
# and have not saved a .tidelift file in your project's repository:
#
# TIDELIFT_ORGANIZATION should be a GitLab CI variable set to your Tidelift
# organization name.
#
# TIDELIFT_CATALOG should be a GitLab CI variable set to your preferred
# catalog name
tidelift-alignment:
# Choose an appropriate image for your build environment.
# Examples include:
#
# image: python
# image: node:20
# image: golang:1.22
stage: build
allow_failure: true
script:
- echo "Downloading Tidelift CLI"
- curl https://download.tidelift.com/cli/tidelift -o tidelift
- echo "Setting permissions"
- chmod +x tidelift
- echo "Creating project if necessary"
- sh -c "./tidelift projects new $CI_PROJECT_NAME ${TIDELIFT_CATALOG:+--catalog $TIDELIFT_CATALOG} || :"
- echo "Running alignment and saving to Tidelift"
- sh -c "./tidelift alignment save --revision $CI_COMMIT_SHA --project $CI_PROJECT_NAME ${TIDELIFT_CATALOG:+--catalog $TIDELIFT_CATALOG} --wait"
tidelift-code-quality:
script: >
curl -fH "Authorization: Bearer $TIDELIFT_API_KEY" https://api.tidelift.com/external-api/v1/catalog/$TIDELIFT_ORGANIZATION/$CI_PROJECT_NAME/alignments/$CI_COMMIT_SHA/gitlab-quality-report > gl-code-quality-report.json
artifacts:
expire_in: 4 days
reports:
codequality: gl-code-quality-report.json