From 024a50f211ad1ee8d9e91246bbee8029589a47c1 Mon Sep 17 00:00:00 2001 From: Julian Psotta Date: Tue, 30 Jan 2024 12:47:54 +0100 Subject: [PATCH] feat(config): Add workflow for the automatic config conversion The workflow is triggered on PRs for main and releases/** branches if the PR is set for review or synchronized. --- .github/workflows/config-conversion-automation.yml | 8 ++++---- ors-api/ors-config.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/config-conversion-automation.yml b/.github/workflows/config-conversion-automation.yml index 41a7943b9a..08b8da3e29 100644 --- a/.github/workflows/config-conversion-automation.yml +++ b/.github/workflows/config-conversion-automation.yml @@ -23,9 +23,9 @@ jobs: - name: Check PR state is ready_for_review run: | if [ "${{ github.event_name }}" == "pull_request" ]; then - pr_is_open=$(gh pr view --json state --jq .state) + pr_state=$(gh pr view --json state --jq .state) pr_is_draft=$(gh pr view --json isDraft --jq .isDraft) - echo "pr_is_open=$pr_is_open" >> $GITHUB_ENV + echo "pr_state=$pr_state" >> $GITHUB_ENV echo "pr_is_draft=$pr_is_draft" >> $GITHUB_ENV else echo "This action is only intended to be run on pull requests." @@ -38,7 +38,7 @@ jobs: .github/utils/config_conversion.sh ors-api/src/main/resources/application.yml ors-api/ors-config.yml - name: Check with git if ors-api/ors-config.yml has changed id: git-check - if: env.pr_is_open == 'true' && env.pr_is_draft == 'false' + if: env.pr_state == 'OPEN' && env.pr_is_draft == 'false' run: | # Don't fail on exit code 1 (diff found) set +e @@ -52,6 +52,6 @@ jobs: echo "Config hasn't changed. Skipping commit." fi - uses: MichaelsJP/git-auto-commit-action@v5 - if: env.pr_is_open == 'true' && env.pr_is_draft == 'false' && env.config_has_changed == 'true' + if: env.pr_state == 'OPEN' && env.pr_is_draft == 'false' && env.config_has_changed == 'true' with: commit_message: 'chore(config): automatic conversion of application.yml to ors-config.yml' diff --git a/ors-api/ors-config.yml b/ors-api/ors-config.yml index f71d2601ac..9617340744 100644 --- a/ors-api/ors-config.yml +++ b/ors-api/ors-config.yml @@ -106,7 +106,7 @@ ors: # graphs_root_path: ./graphs # graphs_data_access: RAM_STORE # elevation: -# preprocessed: false + # preprocessed: true # data_access: MMAP # cache_clear: false # provider: multi