From 6389854bf02f55b27d592e386bba57743e1e6599 Mon Sep 17 00:00:00 2001 From: Nicolas Oudard Date: Wed, 11 Dec 2024 23:20:49 +0100 Subject: [PATCH] test on pull request --- .github/actions/export_acteur/{actions.yml => action.yml} | 4 ++++ .github/workflows/preprod_export_acteur_open_license.yml | 3 ++- .github/workflows/prod_export_acteur_open_license.yml | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) rename .github/actions/export_acteur/{actions.yml => action.yml} (96%) diff --git a/.github/actions/export_acteur/actions.yml b/.github/actions/export_acteur/action.yml similarity index 96% rename from .github/actions/export_acteur/actions.yml rename to .github/actions/export_acteur/action.yml index cac26976b..d477fd397 100644 --- a/.github/actions/export_acteur/actions.yml +++ b/.github/actions/export_acteur/action.yml @@ -36,19 +36,23 @@ runs: with: region: ${{ inputs.SCALINGO_APP_REGION }} - name: Login Scalingo CLI + shell: bash run: | scalingo login --api-token ${{ inputs.SCALINGO_API_TOKEN }} - name: Generate timestamped file name id: generate_filename + shell: bash run: | TIMESTAMP=$(date +'%Y%m%d_%H%M%S') echo "TIMESTAMPED_FILE_NAME=${TIMESTAMP}_${{ inputs.FILE_NAME }}" >> $GITHUB_ENV - name: Execute sync script in one-off container + shell: bash run: | scalingo --app ${{ inputs.SCALINGO_APP }} run \ python manage.py export_displayedacteur --file ${{ env.TIMESTAMPED_FILE_NAME }} continue-on-error: true - name: Get file from s3 + shell: bash run: | aws --endpoint-url ${{ inputs.S3_HOST }} s3 cp ${{ inputs.S3_BUCKET }}/exports/${{ env.TIMESTAMPED_FILE_NAME }} ${{ env.TIMESTAMPED_FILE_NAME }} - name: Save file to artefact diff --git a/.github/workflows/preprod_export_acteur_open_license.yml b/.github/workflows/preprod_export_acteur_open_license.yml index d4f350ba7..2528d1c9b 100644 --- a/.github/workflows/preprod_export_acteur_open_license.yml +++ b/.github/workflows/preprod_export_acteur_open_license.yml @@ -2,6 +2,7 @@ name: "✅ Export des Acteurs sous licence ouverte en PREPROD" on: workflow_dispatch: + pull_request: env: DUPLICATE_API_TOKEN: ${{ secrets.DUPLICATE_API_TOKEN }} @@ -23,7 +24,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Export Displayed Acteur - uses: ./.github/actions/export_displayedacteur + uses: ./.github/actions/export_acteur with: SCALINGO_API_TOKEN: ${{ env.DUPLICATE_API_TOKEN }} SCALINGO_APP: ${{ env.PREPROD_APP }} diff --git a/.github/workflows/prod_export_acteur_open_license.yml b/.github/workflows/prod_export_acteur_open_license.yml index 35a93ecb6..9f36c36be 100644 --- a/.github/workflows/prod_export_acteur_open_license.yml +++ b/.github/workflows/prod_export_acteur_open_license.yml @@ -25,7 +25,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Export Displayed Acteur - uses: ./.github/actions/export_displayedacteur + uses: ./.github/actions/export_acteur with: SCALINGO_API_TOKEN: ${{ env.DUPLICATE_API_TOKEN }} SCALINGO_APP: ${{ env.PRODUCTION_APP }}