You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/github/manage-github-actions-enterprise/includes/manage-encrypted-secrets.md
+70Lines changed: 70 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,3 +61,73 @@ If you need to access the encrypted secret in your action's code, the action cod
61
61
<!-- INFOMAGNUS UPDATES for all of sub OD 4.3 go here! Source Material:https://www.google.com/url?q=https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions&sa=D&source=editors&ust=1742484244534691&usg=AOvVaw30HJhmh-nnnssWIlwRCI_5 -->
62
62
63
63
<!-- Test -->
64
+
=======
65
+
66
+
### Access Encrypted Secrets Within Actions and Workflows
67
+
68
+
#### Example: Using a Secret in a Workflow
69
+
70
+
```yaml
71
+
name: Deploy Application
72
+
73
+
on:
74
+
push:
75
+
branches:
76
+
- main
77
+
78
+
jobs:
79
+
deploy:
80
+
runs-on: ubuntu-latest
81
+
steps:
82
+
- name: Checkout repository
83
+
uses: actions/checkout@v3
84
+
85
+
- name: Use secret in a script
86
+
run: echo "Deploying with API_KEY=${{ secrets.DEPLOYMENT_KEY }}"
87
+
```
88
+
89
+
#### Best Practices for Using Secrets in Workflows
90
+
- **Do not print secrets** in logs using `echo ${{ secrets.SECRET_NAME }}`.
91
+
- **Use secrets within script commands**, rather than assigning them to environment variables.
92
+
- **Limit access** by defining secrets at the **lowest necessary level**.
93
+
- **Rotate secrets periodically** and update workflows accordingly.
94
+
95
+
## How to Use third party Vaults
96
+
97
+
Many enterprises integrate GitHub Actions with external secret management solutions like **HashiCorp Vault, AWS Secrets Manager, and Azure Key Vault**.
0 commit comments