Skip to content

Commit 027376e

Browse files
authored
Update GitHub Actions workflow for branch handling
Should work with coding agent
1 parent 233f2b3 commit 027376e

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/copilot-setup-steps.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ jobs:
1818
steps:
1919
- name: Checkout code
2020
uses: actions/checkout@v4
21+
with:
22+
# Ensures we check out the actual head branch on PRs
23+
ref: ${{ github.head_ref || github.ref_name }}
24+
25+
- name: Derive branch name
26+
id: branch
27+
shell: bash
28+
run: |
29+
BN="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
30+
if [ -z "$BN" ]; then BN="$(git branch --show-current || true)"; fi
31+
echo "BRANCH_NAME=$BN" | tee -a "$GITHUB_ENV"
32+
echo "name=$BN" >> "$GITHUB_OUTPUT"
2133
2234
- name: Set up Python
2335
uses: actions/setup-python@v5
@@ -32,9 +44,9 @@ jobs:
3244
python -m pip install tox pre-commit
3345
# pre-commit run --all-files
3446
# npx mint-mcp add docs.prefect.io
35-
# pre-commit install # don't install, since this has been a source of issues
47+
# pre-commit install
3648
3749
- name: Install branch-specific dependencies
38-
if: ${{ github.ref_name == 'copilot/fix-382' }}
50+
if: ${{ env.BRANCH_NAME == 'copilot/fix-382' }}
3951
run: |
4052
python -m pip install "ax-platform<1" prefect prefect-slack

0 commit comments

Comments
 (0)