Skip to content

Commit 0929417

Browse files
Copilotsmockle
andcommitted
Address PR feedback: move branch extraction after PR close, use env variable for testing repo
Co-authored-by: smockle <[email protected]>
1 parent c549705 commit 0929417

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.ref }}
1818
cancel-in-progress: false # Allow previous workflows’ clean-up steps to complete
1919

20+
env:
21+
TESTING_REPOSITORY: github/accessibility-scanner-testing
22+
2023
jobs:
2124
test:
2225
name: Test
@@ -74,7 +77,7 @@ jobs:
7477
login_url: http://127.0.0.1:4000/
7578
username: ${{ secrets.TEST_USERNAME }}
7679
password: ${{ secrets.TEST_PASSWORD }}
77-
repository: github/accessibility-scanner-testing
80+
repository: ${{ env.TESTING_REPOSITORY }}
7881
token: ${{ secrets.GH_TOKEN }}
7982
cache_key: ${{ steps.cache_key.outputs.cache_key }}
8083

@@ -109,11 +112,11 @@ jobs:
109112
| while read -r URL; do
110113
if [[ "$URL" == *"/pull/"* ]]; then
111114
echo "Closing pull request: $URL"
112-
branch="$(gh pr view "$URL" --json headRefName -q .headRefName)" || true
113115
gh pr close "$URL" || echo "Failed to close pull request: $URL"
116+
branch="$(gh pr view "$URL" --json headRefName -q .headRefName || true)"
114117
if [[ -n "$branch" ]]; then
115118
echo "Deleting branch: $branch"
116-
git push https://github.com/github/accessibility-scanner-testing --delete "$branch" || echo "Failed to delete branch: $branch"
119+
git push "https://github.com/${{ env.TESTING_REPOSITORY }}" --delete "$branch" || echo "Failed to delete branch: $branch"
117120
fi
118121
elif [[ "$URL" == *"/issues/"* ]]; then
119122
echo "Closing issue: $URL"

0 commit comments

Comments
 (0)