@@ -24,6 +24,7 @@ for details on how to use it.
2424- [ ` config-npm ` ] ( #config-npm )
2525- [ ` build-npm ` ] ( #build-npm )
2626- [ ` build-yarn ` ] ( #build-yarn )
27+ - [ ` config-pip ` ] ( #config-pip )
2728- [ ` promote ` ] ( #promote )
2829- [ ` pr_cleanup ` ] ( #pr_cleanup )
2930- [ ` cache ` ] ( #cache )
@@ -1058,6 +1059,107 @@ jobs:
10581059- Support for different branch types (default, maintenance, PR, dogfood, long-lived feature)
10591060- Comprehensive build logging and error handling
10601061
1062+ # # `config-pip`
1063+
1064+ Configure pip build environment with build number, authentication, and default settings.
1065+
1066+ This action configures pip to pull packages from the internal JFrog Artifactory registry instead of the default PyPI.
1067+
1068+ > **Note:** This action automatically calls [`get-build-number`](#get-build-number) to manage the build number.
1069+ > **Note:** This action replaces the deprecated `configure-pipx-repox` action from `sonarqube-cloud-github-actions` repository.
1070+
1071+ # ## Requirements
1072+
1073+ # ### Required GitHub Permissions
1074+
1075+ - `id-token : write`
1076+ - `contents : read`
1077+
1078+ # ### Required Vault Permissions
1079+
1080+ - `public-reader` or `private-reader` : Artifactory role for reading dependencies.
1081+
1082+ # ## Usage
1083+
1084+ ` ` ` yaml
1085+ permissions:
1086+ id-token: write
1087+ contents: read
1088+ steps:
1089+ - uses: actions/checkout@v5
1090+ - uses: actions/setup-python@v5
1091+ with:
1092+ python-version: 3.12
1093+ - uses: SonarSource/ci-github-actions/config-pip@v1
1094+ - run: pip install pipenv
1095+ ` ` `
1096+
1097+ # ## With Custom Artifactory Reader Role
1098+
1099+ ` ` ` yaml
1100+ steps:
1101+ - uses: SonarSource/ci-github-actions/config-pip@v1
1102+ with:
1103+ artifactory-reader-role: custom-reader
1104+ ` ` `
1105+
1106+ # ## With Working Directory and Caching Options
1107+
1108+ ` ` ` yaml
1109+ steps:
1110+ - uses: SonarSource/ci-github-actions/config-pip@v1
1111+ with:
1112+ working-directory: ./python-project
1113+ disable-caching: false
1114+ ` ` `
1115+
1116+ # ## Inputs
1117+
1118+ | Input | Description | Default |
1119+ |---------------------------|-----------------------------------------------------------------------------|----------------------------------------------------------------------|
1120+ | `working-directory` | Relative path under github.workspace to execute the build in | `.` |
1121+ | `artifactory-reader-role` | Suffix for the Artifactory reader role in Vault | `private-reader` for private repos, `public-reader` for public repos |
1122+ | `repox-url` | URL for Repox | `https://repox.jfrog.io` |
1123+ | `repox-artifactory-url` | URL for Repox Artifactory API (overrides repox-url/artifactory if provided) | (optional) |
1124+ | `cache-paths` | Cache paths to use (multiline) | `~/.cache/pip` |
1125+ | `disable-caching` | Whether to disable pip caching entirely | `false` |
1126+
1127+ # ## Outputs
1128+
1129+ | Output | Description |
1130+ |----------------|---------------------------------------------------------------------------|
1131+ | `BUILD_NUMBER` | The current build number. Also set as environment variable `BUILD_NUMBER` |
1132+
1133+ # ## Output Environment Variables
1134+
1135+ | Environment Variable | Description |
1136+ |----------------------|--------------------------|
1137+ | `BUILD_NUMBER` | The current build number |
1138+
1139+ See also [`get-build-number`](#get-build-number) output environment variables.
1140+
1141+ # ## Features
1142+
1143+ - Build number management via [`get-build-number`](#get-build-number)
1144+ - Automatic Artifactory authentication via Vault
1145+ - Auto-detection of reader role based on repository visibility
1146+ - Pip dependency caching with customization options
1147+ - Global pip configuration for all subsequent `pip install` commands
1148+
1149+ # ## Migration from configure-pipx-repox
1150+
1151+ If you're currently using `SonarSource/sonarqube-cloud-github-actions/configure-pipx-repox@master`, you can replace it with :
1152+
1153+ ` ` ` yaml
1154+ # Old
1155+ - uses: SonarSource/sonarqube-cloud-github-actions/configure-pipx-repox@master
1156+
1157+ # New
1158+ - uses: SonarSource/ci-github-actions/config-pip@v1
1159+ ` ` `
1160+
1161+ Both actions produce the same configuration and are functionally equivalent.
1162+
10611163# # `promote`
10621164
10631165This action promotes a build in JFrog Artifactory and updates the GitHub status check accordingly.
0 commit comments