Concept: Commands and Arguments #318
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run tests for bash or markdown files modified in this PR. | |
name: bash / pr | |
on: pull_request | |
jobs: | |
ci: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- name: Install bats-core | |
run: sudo apt update && sudo apt -y install bats | |
- 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 == "added" or .status == "modified" or .status == "renamed") | | |
select(.filename | match("\\.(sh|bash|bats)$")) | | |
.filename | |
' | xargs -r bash .github/scripts/pr |