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
description: 'Instructions for editing GitHub Actions workflows for this repository.'
4
+
---
5
+
6
+
# Copilot Instructions for `.github/{actions,workflows}/*.{yml,yaml}` files
7
+
8
+
## PURPOSE
9
+
10
+
This file contains instructions for working with GitHub Actions YAML files in the `.github/actions/` and `.github/workflows/` directories of the `codeql-sap-js` repository.
11
+
12
+
## REQUIREMENTS
13
+
14
+
-**ALWAYS pin ALL external GitHub Actions to full-length commit SHAs, never to tags or branch names — including GitHub-maintained `actions/*` actions.** Add a trailing comment with the original tag for readability (e.g., `uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6`). To resolve a tag to its commit SHA, run `git ls-remote https://github.com/OWNER/REPO.git refs/tags/TAG` (or `refs/heads/BRANCH` for branch-based refs).
15
+
- ALWAYS use the principle of least privilege, and explicitly set `permissions` for workflows.
16
+
- ALWAYS use valid YAML syntax and follow GitHub Actions workflow conventions.
17
+
- ALWAYS follow best practices for GitHub Actions workflows including security, efficiency, and maintainability.
18
+
- ALWAYS use descriptive names for workflows, jobs, and steps that clearly explain their purpose.
19
+
20
+
## PREFERENCES
21
+
22
+
- PREFER explicit permissions declarations using the `permissions` key for security.
23
+
- PREFER descriptive step names that include the workflow context (e.g., "Tag - Checkout repository").
24
+
- PREFER matrix strategies for testing multiple versions when applicable.
25
+
- PREFER adding summary outputs using `$GITHUB_STEP_SUMMARY` for better workflow visibility.
26
+
27
+
## CONSTRAINTS
28
+
29
+
-**NEVER reference an external GitHub Action by tag or branch name (e.g., `@v6`, `@main`). ALWAYS use the full 40-character commit SHA with a `# tag` comment.**
30
+
- NEVER use overly broad permissions.
31
+
- NEVER leave any trailing whitespace on any line.
32
+
- NEVER use deprecated GitHub Actions or workflow syntax.
0 commit comments