Skip to content

Commit 2a5874a

Browse files
committed
Updates
1 parent 8e70928 commit 2a5874a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

learn-pr/github/github-actions-automate-tasks/includes/2-github-actions-automate-development-tasks.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ When creating workflows in GitHub Actions, you can reference actions from variou
176176
uses: actions/checkout@v3
177177
```
178178

179+
[!IMPORTANT]
180+
> **For better security, use a full commit SHA when referencing actions—not just a tag like `@v3`.**
181+
> This makes sure your workflow always uses the exact same code, even if the action is updated or changed later.
182+
> Example: `uses: actions/checkout@c2c1744e079e0dd11c8e0af4a96064ca4f6a2e9e`
183+
179184
3. **The same repository as your workflow file**
180185
You can reference actions stored in the same repository as your workflow file. This is useful for custom actions that are specific to your project. To reference such actions, use a relative path to the action's directory. For example:
181186
```yml
@@ -184,6 +189,8 @@ When creating workflows in GitHub Actions, you can reference actions from variou
184189
uses: ./path-to-action
185190
```
186191

192+
For more details, see [security hardening guidance for GitHub Actions](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#using-third-party-actions).
193+
187194
4. **An enterprise marketplace**
188195
If your organization uses GitHub Enterprise, you can reference actions from your enterprise's private marketplace. These actions are curated and managed by your organization, ensuring compliance with internal standards. For example:
189196
```yml
@@ -196,7 +203,8 @@ When creating workflows in GitHub Actions, you can reference actions from variou
196203
- Actions in private repositories can also be referenced, but they require proper authentication and permissions.
197204
- When referencing actions, always specify a version (Git ref, SHA, or tag) to ensure consistency and avoid unexpected changes.
198205

199-
For more information, see [Referencing actions in workflows](https://docs.github.com/actions/using-workflows/referencing-actions-in-workflows?azure-portal=true).
206+
For more information, see [Referencing actions in workflows](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions).
207+
200208

201209
## GitHub-hosted versus self-hosted runners
202210

0 commit comments

Comments
 (0)