Skip to content

Commit

Permalink
Update call_fts3.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz authored Sep 21, 2023
1 parent 7db99a3 commit ce1185c
Showing 1 changed file with 10 additions and 37 deletions.
47 changes: 10 additions & 37 deletions .github/workflows/call_fts3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- 'main'

paths:
- 'databases/**.json'

workflow_dispatch:
inputs:
base:
Expand Down Expand Up @@ -36,43 +39,13 @@ jobs:
with:
fetch-depth: 0



- name: Base SHA
id: create-matrix

- name: Get changed files with git diff and send to fts3-connector
id: git-diff
run: |
matrix_json='['
first=true
for file in $(git diff --name-only -r origin/${{ github.base_ref || github.event.inputs.base }} origin/${{ github.head_ref || github.event.inputs.head }} | grep databases/); do
if [ "$first" = true ]; then
first=false
else
matrix_json+=','
fi
matrix_json+="\"$file\""
done
matrix_json+=']'
echo "matrix=$matrix_json" >> $GITHUB_OUTPUT
for file in "$git diff --name-only -r origin/${{ github.base_ref || github.event.inputs.base }} origin/${{ github.head_ref || github.event.inputs.head }} | grep databases/)"; do
echo "Calling with $file"
curl -H "X-AUTH-HEADER: ${{ secrets.FTS3_CLIENT_API_KEY }}" -H "Content-Type: application/json" -X POST -d @$file "${{ vars.FTS3_CLIENT_ENDPOINT }}/transfer/dry"
done
# - name: Get changed files with git diff and send to fts3-connector
# id: git-diff
# run: |
# for file in "${steps.create-matrix.outputs.matrix[@]}"; do
# echo "Calling with $file"
# curl -H "X-AUTH-HEADER: ${{ secrets.FTS3_CLIENT_API_KEY }}" -H "Content-Type: application/json" -X POST -d @$file "${{ vars.FTS3_CLIENT_ENDPOINT }}/transfer/dry"
#done
validate_changed_jsons:
needs: changed-files
if: ${{ needs.changed-files.outputs.changed_files }}
strategy:
fail-fast: false
matrix:
FILENAME: ${{fromJSON( needs.changed-files.outputs.changed_files)}}
uses: ./.github/workflows/validate_database_json.yml
with:
FILENAME: ${{ matrix.FILENAME }}
secrets: inherit

0 comments on commit ce1185c

Please sign in to comment.