Skip to content

patch(godog): tag a feature #15

patch(godog): tag a feature

patch(godog): tag a feature #15

name: List all changed files
on:
pull_request:
branches:
- main
jobs:
changed-files:
name: Changed Files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
- name: List all changed files
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
# Validate every changed file via HTTP request.
for file in $ALL_CHANGED_FILES; do
# Send HTTP POST request with file content
response_code=$(curl -s -o /dev/null -w "%{http_code}" https://test-center.staging.internal.upvest.io/api/features/validate \
-X POST \
--data-binary "@$file" \
-H "Content-Type: text/plain" \
-H "TC-Access-Token: ${{ secrets.TC_API_TOKEN }}" \
-H "TC-Access-User: ${{ github.actor }}")
# Log the file name and its corresponding HTTP response code
echo "File: $file, Response Code: $response_code"
# Optionally, you can fail the job if the response code is not 200
if [ "$response_code" -ne 204 ]; then
echo "Request for $file failed with response code $response_code"
exit 1
fi
done