Skip to content

Add step to fetch configlet to PR template #333

Add step to fetch configlet to PR template

Add step to fetch configlet to PR template #333

Workflow file for this run

# Run tests for jq or test files modified in this PR.
name: jq / pr
on: pull_request
jobs:
pr:
runs-on: ubuntu-22.04
steps:
- name: Checkout PR
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Install software
run: |
sudo apt update && sudo apt -y install bats &&
sudo curl -L -o /usr/bin/jq https://github.com/jqlang/jq/releases/download/jq-1.7/jq-linux-amd64 &&
sudo chmod -v 755 /usr/bin/jq
- name: Run tests for changed/added exercises
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pr_endpoint=$(jq -r '"repos/\(.repository.full_name)/pulls/\(.pull_request.number)"' "$GITHUB_EVENT_PATH")
gh api "$pr_endpoint/files" --paginate --jq '
.[]
| select(.status | IN("added", "modified", "renamed"))
| select(.filename | test("\\.(jq|bats|bash)$"))
| .filename
' | xargs -r bash bin/pr