Skip to content

Commit f86621c

Browse files
CopilotlpcoxCopilot
authored
Harden gh-aw installation in agentic workflow lock files (#3260)
* Initial plan * fix: harden gh-aw workflow installer steps * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Landon Cox <landon.cox@microsoft.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent a770aca commit f86621c

3 files changed

Lines changed: 59 additions & 26 deletions

File tree

.github/workflows/ci-cd-gaps-assessment.lock.yml

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/pelis-agent-factory-advisor.lock.yml

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import * as fs from 'fs';
2+
import * as path from 'path';
3+
4+
const workflowsDir = path.resolve(__dirname, '../../.github/workflows');
5+
const lockFiles = fs.readdirSync(workflowsDir).filter(file => file.endsWith('.lock.yml'));
6+
7+
describe('workflow gh-aw extension installs', () => {
8+
it('uses the resilient gh-aw installer in every lock workflow', () => {
9+
const workflowsWithLegacyInstall: string[] = [];
10+
let foundGhAwInstallStep = false;
11+
12+
for (const lockFile of lockFiles) {
13+
const workflowContent = fs.readFileSync(path.join(workflowsDir, lockFile), 'utf-8');
14+
15+
if (
16+
workflowContent.includes('gh extension install github/gh-aw') ||
17+
workflowContent.includes('gh extension upgrade gh-aw || true')
18+
) {
19+
workflowsWithLegacyInstall.push(lockFile);
20+
}
21+
22+
if (!workflowContent.includes('name: Install gh-aw extension')) {
23+
continue;
24+
}
25+
26+
foundGhAwInstallStep = true;
27+
expect(workflowContent).toMatch(/install-gh-aw\.sh/);
28+
expect(workflowContent).toMatch(/-type f -executable/);
29+
expect(workflowContent).toMatch(/Failed to find gh-aw binary for MCP server/);
30+
}
31+
32+
expect(foundGhAwInstallStep).toBe(true);
33+
expect(workflowsWithLegacyInstall).toEqual([]);
34+
});
35+
});

0 commit comments

Comments
 (0)