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
* Pin actions to full-length commit SHAs
This commit:
- pins each GitHub Action, regardless of publisher/maintainter, to
its full-length commit SHA (instead of tag) to ensure that all
actions refs are immutable;
- updates the .github/instructions/*.md for actions and workflows;
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com>
* Update github_workflows_yaml.instructions.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com>
---------
Signed-off-by: Nathan Randall <70299490+data-douser@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
description: 'Instructions for editing GitHub Actions workflows for this repository.'
4
4
---
5
5
6
-
# Copilot Instructions for `.github/workflows/*.{yml,yaml}` files
6
+
# Copilot Instructions for `.github/{actions,workflows}/**/*.{yml,yaml}` files
7
7
8
8
## PURPOSE
9
9
10
-
This file contains instructions for working with GitHub Actions workflow files in the `.github/workflows/`directory of the `codeql-development-mcp-server` repository.
10
+
This file contains instructions for working with GitHub Actions YAML files in the `.github/actions/` and `.github/workflows/`directories of the `codeql-development-mcp-server` repository.
11
11
12
12
## REQUIREMENTS
13
13
14
14
-**ALWAYS run `npm run build-and-test` from the repo root directory and ensure it passes completely before committing any changes. This is MANDATORY and must be verified before every commit.**
15
+
-**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 underlying commit SHA (handling annotated tags correctly), run `git ls-remote https://github.com/OWNER/REPO.git refs/tags/TAG^{}`; for branch-based refs, use `refs/heads/BRANCH`.
15
16
- ALWAYS use the principle of least privilege, and explicitly set `permissions` for workflows.
16
17
- ALWAYS use valid YAML syntax and follow GitHub Actions workflow conventions.
17
18
- ALWAYS follow best practices for GitHub Actions workflows including security, efficiency, and maintainability.
@@ -22,14 +23,14 @@ This file contains instructions for working with GitHub Actions workflow files i
22
23
23
24
## PREFERENCES
24
25
25
-
- PREFER using the latest stable versions of GitHub Actions (e.g., `actions/checkout@v6`, `actions/setup-node@v6`).
26
26
- PREFER explicit permissions declarations using the `permissions` key for security.
27
27
- PREFER descriptive step names that include the workflow context (e.g., "Lint and Format - Checkout repository").
28
28
- PREFER matrix strategies for testing multiple versions when applicable.
29
29
- PREFER adding summary outputs using `$GITHUB_STEP_SUMMARY` for better workflow visibility.
30
30
31
31
## CONSTRAINTS
32
32
33
+
-**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.**
33
34
- NEVER use overly broad permissions.
34
35
- NEVER leave any trailing whitespace on any line.
35
36
- NEVER use deprecated GitHub Actions or workflow syntax.
0 commit comments