Skip to content

Dweinholz patch 1

Dweinholz patch 1 #23

Workflow file for this run

# Forked from eKatchko/public-bioinformatics-databases
name: Process changed files
# Controls when the workflow will run
on:
pull_request:
branches:
- 'main'
paths:
- 'databases/**.json'
workflow_dispatch:
inputs:
base:
type: string
default: main
required: true
head:
type: string
required: true
jobs:
# This workflow contains a single job called "changed-files"
changed-files:
# The type of runner that the job will run on
runs-on: [self-hosted, fts3-client-production ]
environment: APPROVAL_REQUIRED
outputs:
changed_files: ${{ steps.create-matrix.outputs.matrix }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Base SHA
id: create-matrix
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
# - 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
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