Skip to content

Commit c53f1b8

Browse files
authored
Merge pull request #56011 from github/repo-sync
Repo sync
2 parents 1c3dca4 + 7ec695e commit c53f1b8

File tree

4 files changed

+45
-51
lines changed

4 files changed

+45
-51
lines changed

content/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-jfrog.md

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -47,59 +47,52 @@ To use OIDC with JFrog, establish a trust relationship between {% data variables
4747

4848
## Updating your {% data variables.product.prodname_actions %} workflow
4949

50-
Once you establish a trust relationship between {% data variables.product.prodname_actions %} and the JFrog platform, you can update your {% data variables.product.prodname_actions %} workflow file.
50+
### Authenticating with JFrog using OIDC
5151

5252
In your {% data variables.product.prodname_actions %} workflow file, ensure you are using the provider name and audience you configured in the JFrog Platform.
5353

54-
The following example uses the placeholder `YOUR_PROVIDER_NAME`.
54+
The following example uses the placeholders `YOUR_PROVIDER_NAME` and `YOUR_AUDIENCE`.
5555

5656
```yaml
57-
- name: Fetch Access Token from Artifactory
58-
id: fetch_access_token
59-
env:
60-
ID_TOKEN: ${{ steps.idtoken.outputs.id_token }}
61-
run: |
62-
ACCESS_TOKEN=$(curl \
63-
-X POST \
64-
-H "Content-type: application/json" \
65-
https://example.jfrog.io/access/api/v1/oidc/token \
66-
-d \
67-
"{\"grant_type\": \"urn:ietf:params:oauth:grant-type:token-exchange\", \"subject_token_type\":\"urn:ietf:params:oauth:token-type:id_token\", \"subject_token\": \"$ID_TOKEN\", \"provider_name\": \"YOUR_PROVIDER_NAME\"}" | jq .access_token | tr -d '"')
68-
echo ACCESS_TOKEN=$ACCESS_TOKEN >> $GITHUB_OUTPUT
69-
```
70-
71-
The following example shows part of a {% data variables.product.prodname_actions %} workflow file using cURL.
72-
73-
```yaml
74-
- name: Get ID Token (cURL method)
75-
id: idtoken
76-
run: |
77-
ID_TOKEN=$(curl -sLS -H "User-Agent: actions/oidc-client" -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
78-
"${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=jfrog-github" | jq .value | tr -d '"')
79-
echo "ID_TOKEN=${ID_TOKEN}" >> $GITHUB_OUTPUT
80-
```
81-
82-
Alternatively, you can set the audience as an environment variable using the `env` context. For more information about the `env` context, see [AUTOTITLE](/actions/learn-github-actions/contexts#env-context).
83-
84-
{% data reusables.actions.oidc-deployment-protection-rules %}
57+
permissions:
58+
id-token: write
59+
contents: read
8560

86-
```yaml
8761
jobs:
8862
build:
8963
runs-on: ubuntu-latest
90-
env:
91-
OIDC_AUDIENCE: 'YOUR_AUDIENCE'
64+
steps:
65+
- name: Set up JFrog CLI with OIDC
66+
id: setup-jfrog-cli
67+
uses: jfrog/setup-jfrog-cli@29fa5190a4123350e81e2a2e8d803b2a27fed15e
68+
with:
69+
JF_URL: ${{ env.JF_URL }}
70+
oidc-provider-name: 'YOUR_PROVIDER_NAME'
71+
oidc-audience: 'YOUR_AUDIENCE' # This is optional
72+
73+
- name: Upload artifact
74+
run: jf rt upload "dist/*.zip" my-repo/
75+
9276
```
9377

94-
Then, in your workflow file, retrieve the value of the variables stored in the `env` context. The following example uses the `env` context to retrieve the OIDC audience.
78+
> [!TIP]
79+
> When OIDC authentication is used, the `setup-jfrog-cli` action automatically provides `oidc-user` and `oidc-token` as step outputs.
80+
> These can be used for other integrations that require authentication with JFrog.
81+
> To reference these outputs, ensure the step has an explicit `id` defined (for example `id: setup-jfrog-cli`).
9582
83+
### Using OIDC Credentials in other steps
9684
```yaml
97-
- name: Get ID Token (using env context)
98-
uses: {% data reusables.actions.action-github-script %}
99-
id: idtoken
85+
- name: Sign in to Artifactory Docker registry
86+
uses: docker/login-action@v3
10087
with:
101-
script: |
102-
const coredemo = require('@actions/core');
103-
let id_token = await coredemo.getIDToken(process.env.OIDC_AUDIENCE);
104-
coredemo.setOutput('id_token', id_token);
88+
registry: ${{ env.JF_URL }}
89+
username: ${{ steps.setup-jfrog-cli.outputs.oidc-user }}
90+
password: ${{ steps.setup-jfrog-cli.outputs.oidc-token }}
91+
```
92+
93+
## Further reading
94+
95+
- [OpenID Connect Integration](https://jfrog.com/help/r/jfrog-platform-administration-documentation/openid-connect-integration) in the JFrog documentation
96+
- [Identity Mappings](https://jfrog.com/help/r/jfrog-platform-administration-documentation/identity-mappings) in the JFrog documentation
97+
- [AUTOTITLE](actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
10598
```

content/copilot/using-github-copilot/ai-models/changing-the-ai-model-for-copilot-chat.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ For more information about these models, see [AUTOTITLE](/copilot/using-github-c
4949

5050
Experimental pre-release versions of the models may not interact with all filters correctly, including the duplication detection filter.
5151

52-
## Changing your AI model
52+
## Changing the AI model
5353

5454
These instructions are for {% data variables.product.prodname_copilot_short %} on the {% data variables.product.github %} website. For instructions on different clients, click the appropriate tab at the top of this page.
5555

@@ -94,9 +94,9 @@ The following models are currently available through multi-model {% data variabl
9494

9595
For more information about these models, see [AUTOTITLE](/copilot/using-github-copilot/ai-models/choosing-the-right-ai-model-for-your-task).
9696

97-
## Changing your AI model
97+
## Changing the AI model
9898

99-
These instructions are for {% data variables.product.prodname_vscode_shortname %}. For instructions on different clients, click the appropriate tab at the top of this page.
99+
These instructions are for {% data variables.product.prodname_vscode %}. For instructions on different clients, click the appropriate tab at the top of this page.
100100

101101
{% data reusables.copilot.model-picker-enable-alternative-models %}
102102

@@ -128,7 +128,7 @@ The following models are currently available through multi-model {% data variabl
128128

129129
For more information about these models, see [AUTOTITLE](/copilot/using-github-copilot/ai-models/choosing-the-right-ai-model-for-your-task).
130130

131-
## Changing the AI model for {% data variables.copilot.copilot_chat_short %}
131+
## Changing the AI model
132132

133133
These instructions are for {% data variables.product.prodname_vs %}. For instructions on different clients, click the appropriate tab at the top of this page.
134134

@@ -168,7 +168,7 @@ The following models are currently available through multi-model {% data variabl
168168

169169
For more information about these models, see [AUTOTITLE](/copilot/using-github-copilot/ai-models/choosing-the-right-ai-model-for-your-task).
170170

171-
## Changing the AI model for {% data variables.copilot.copilot_chat_short %}
171+
## Changing the AI model
172172

173173
These instructions are for the JetBrains IDEs. For instructions on different clients, click the appropriate tab at the top of this page.
174174

@@ -178,7 +178,7 @@ These instructions are for the JetBrains IDEs. For instructions on different cli
178178

179179
1. Click the **{% octicon "copilot" aria-hidden="true" aria-label="copilot" %}** icon in the status bar.
180180
1. In the popup menu, click **Open {% data variables.copilot.copilot_chat %}**.
181-
1. In the bottom right of the chat view, select an AI model of your choice from the {% octicon "chevron-down" aria-hidden="true" aria-label="chevron-down" %} dropdown menu.
181+
1. In the bottom right of the chat view, select an AI model of your choice from the **CURRENT-MODEL** {% octicon "chevron-down" aria-hidden="true" aria-label="chevron-down" %} dropdown menu, then click the AI model of your choice.
182182

183183
{% endjetbrains %}
184184

@@ -207,7 +207,7 @@ The following models are currently available through multi-model {% data variabl
207207

208208
For more information about these models, see [AUTOTITLE](/copilot/using-github-copilot/ai-models/choosing-the-right-ai-model-for-your-task).
209209

210-
## Changing the AI model for {% data variables.copilot.copilot_chat_short %}
210+
## Changing the AI model
211211

212212
These instructions are for the Eclipse IDE. For instructions on different clients, click the appropriate tab at the top of this page.
213213

@@ -246,7 +246,7 @@ The following models are currently available through multi-model {% data variabl
246246

247247
For more information about these models, see [AUTOTITLE](/copilot/using-github-copilot/ai-models/choosing-the-right-ai-model-for-your-task).
248248

249-
## Changing the AI model for {% data variables.copilot.copilot_chat_short %}
249+
## Changing the AI model
250250

251251
These instructions are for Xcode. For instructions on different clients, click the appropriate tab at the top of this page.
252252

content/copilot/using-github-copilot/ai-models/using-gemini-in-github-copilot.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ redirect_from:
1919

2020
* {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_vscode %}
2121
* Immersive mode in {% data variables.copilot.copilot_chat_short %} in {% data variables.product.github %}
22+
* {% data variables.copilot.copilot_chat_short %} in JetBrains IDEs
2223

2324
{% data variables.product.prodname_copilot %} uses {% data variables.copilot.copilot_gemini_flash %} and {% data variables.copilot.copilot_gemini_25_pro %} hosted on Google Cloud Platform (GCP). When using {% data variables.copilot.copilot_gemini %} models, prompts and metadata are sent to GCP, which makes the [following data commitment](https://cloud.google.com/gemini/docs/discover/data-governance): _{% data variables.copilot.copilot_gemini %} doesn't use your prompts, or its responses, as data to train its models._
2425

@@ -34,7 +35,7 @@ You must enable access to {% data variables.copilot.copilot_gemini_flash %} and
3435

3536
> [!NOTE] {% data variables.copilot.copilot_gemini_25_pro %} is not currently available for {% data variables.copilot.copilot_free_short %}.
3637
37-
If you have a {% data variables.copilot.copilot_free_short %}, {% data variables.copilot.copilot_pro_short %}, or {% data variables.copilot.copilot_pro_plus_short %} subscription, you can enable {% data variables.copilot.copilot_gemini %} in two ways:
38+
If you have a {% data variables.copilot.copilot_free_short %}, {% data variables.copilot.copilot_pro_short %}, or {% data variables.copilot.copilot_pro_plus_short %} subscription, you can enable the {% data variables.copilot.copilot_gemini %} models available to your plan in two ways:
3839

3940
* The first time you choose to use {% data variables.copilot.copilot_gemini %} models with {% data variables.copilot.copilot_chat_short %} in {% data variables.product.prodname_vscode %}, or in the immersive view of {% data variables.copilot.copilot_chat_short %}, you will be prompted to allow access to the model.
4041

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Use these workflows as a starting place to build your custom workflow or use them as-is. You can browse the full list of workflow templates in the [actions/starter-workflows](https://github.com/actions/starter-workflows) repository. For more information, see [AUTOTITLE](/actions/writing-workflows/using-starter-workflows).
1+
Use these workflows as a starting place to build your custom workflow or use them as-is. You can browse the full list of workflow templates in the [actions/starter-workflows](https://github.com/actions/starter-workflows) repository.

0 commit comments

Comments
 (0)