-
Notifications
You must be signed in to change notification settings - Fork 295
Add integration test for adding workflows from githubnext/agentics #16421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -2073,3 +2073,148 @@ jobs: | |||||||
| name: safe-outputs-conformance-report | ||||||||
| path: conformance-output.txt | ||||||||
| retention-days: 7 | ||||||||
|
|
||||||||
| integration-add: | ||||||||
| name: Integration Add Workflows | ||||||||
| runs-on: ubuntu-latest | ||||||||
| permissions: | ||||||||
| contents: read | ||||||||
| concurrency: | ||||||||
| group: ci-${{ github.ref }}-integration-add | ||||||||
| cancel-in-progress: true | ||||||||
| steps: | ||||||||
| - name: Checkout code | ||||||||
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 | ||||||||
|
|
||||||||
| - name: Set up Go | ||||||||
| id: setup-go | ||||||||
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6 | ||||||||
| with: | ||||||||
| go-version-file: go.mod | ||||||||
| cache: true | ||||||||
|
|
||||||||
| - name: Report Go cache status | ||||||||
| run: | | ||||||||
| if [ "${{ steps.setup-go.outputs.cache-hit }}" == "true" ]; then | ||||||||
| echo "✅ Go cache hit" >> $GITHUB_STEP_SUMMARY | ||||||||
| else | ||||||||
| echo "⚠️ Go cache miss" >> $GITHUB_STEP_SUMMARY | ||||||||
| fi | ||||||||
|
|
||||||||
| - name: Download dependencies | ||||||||
| run: go mod download | ||||||||
|
|
||||||||
| - name: Verify dependencies | ||||||||
| run: go mod verify | ||||||||
|
|
||||||||
| - name: Build gh-aw binary | ||||||||
| run: make build | ||||||||
|
|
||||||||
| - name: Verify gh-aw binary | ||||||||
| run: | | ||||||||
| ./gh-aw --help | ||||||||
| ./gh-aw version | ||||||||
|
|
||||||||
| - name: Clone githubnext/agentics repository | ||||||||
| run: | | ||||||||
| echo "Cloning githubnext/agentics repository..." | ||||||||
| cd /tmp | ||||||||
| git clone --depth 1 --filter=blob:none https://github.com/githubnext/agentics.git | ||||||||
| echo "✅ Repository cloned successfully" | ||||||||
|
|
||||||||
| - name: List workflows from agentics | ||||||||
| id: list-workflows | ||||||||
| run: | | ||||||||
| echo "Listing workflow files from githubnext/agentics..." | ||||||||
| cd /tmp/agentics/workflows | ||||||||
|
|
||||||||
| # Get list of all .md workflow files (just the names without .md extension) | ||||||||
| WORKFLOWS=$(ls *.md | sed 's/\.md$//') | ||||||||
|
|
||||||||
| echo "Found workflows:" | ||||||||
| echo "$WORKFLOWS" | ||||||||
|
|
||||||||
| # Count workflows | ||||||||
| WORKFLOW_COUNT=$(echo "$WORKFLOWS" | wc -l) | ||||||||
| echo "Total workflows found: $WORKFLOW_COUNT" | ||||||||
|
|
||||||||
| # Save workflow list for next step | ||||||||
| echo "$WORKFLOWS" > /tmp/workflow-list.txt | ||||||||
| echo "workflow_count=$WORKFLOW_COUNT" >> $GITHUB_OUTPUT | ||||||||
|
|
||||||||
| - name: Add workflows one by one | ||||||||
| id: add-workflows | ||||||||
| env: | ||||||||
| GH_TOKEN: ${{ github.token }} | ||||||||
| run: | | ||||||||
| cd /home/runner/work/gh-aw/gh-aw | ||||||||
|
||||||||
| cd /home/runner/work/gh-aw/gh-aw | |
| cd "$GITHUB_WORKSPACE" |
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow list may contain empty lines if there are any empty entries from the sed command or if the file list has issues. When iterating with while IFS= read -r workflow, empty lines will still be processed, potentially causing gh-aw add to be called with an empty string or just the repository path. Add a check to skip empty lines: add [ -z "$workflow" ] && continue right after the do statement on line 2161.
| while IFS= read -r workflow; do | |
| while IFS= read -r workflow; do | |
| [ -z "$workflow" ] && continue |
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tee command always returns 0 (success) regardless of the exit code of the piped command before it. This means the if condition will always evaluate to true, and failures won't be caught properly. To fix this, you should set PIPEFAIL before the loop: add set -o pipefail at the beginning of the script block (after the cd command). This ensures that the exit code of the piped command is preserved even when using tee.
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow names are used directly in the log file path /tmp/add-${workflow}.log without sanitization. If a workflow name contains special characters like spaces, slashes, or other shell metacharacters, this could cause issues or security vulnerabilities. While the githubnext/agentics repository likely has well-formed workflow names, it's a best practice to sanitize the workflow name before using it in file paths. Consider using parameter expansion to remove or replace problematic characters: SAFE_NAME=$(echo "$workflow" | tr -c '[:alnum:]-_' '_').
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow list parsing doesn't handle edge cases properly. If the
/tmp/agentics/workflowsdirectory is empty or contains no.mdfiles, thels *.mdcommand will fail with an error, causing the entire step to fail. Consider adding error handling:WORKFLOWS=$(ls *.md 2>/dev/null | sed 's/\.md$//' || echo "")and then check if WORKFLOWS is empty before proceeding. Additionally, add a conditional check after line 2143 to handle the case where no workflows are found.This issue also appears on line 2138 of the same file.