Skip to content

Commit

Permalink
feat(config): Add workflow for the automatic config conversion
Browse files Browse the repository at this point in the history
The workflow is triggered on PRs for main and releases/** branches if the PR is set for review or synchronized.
  • Loading branch information
MichaelsJP committed Jan 30, 2024
1 parent 965e15a commit 563ee79
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
File renamed without changes.
41 changes: 41 additions & 0 deletions .github/workflows/config-conversion-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Automatic conversion of application.yml to ors-config.yml
on:
pull_request:
branches:
- main
- releases/**
- feat/config-cleanup-finalize # for testing
types: [ ready_for_review, synchronize ]
workflow_dispatch:


jobs:
detect_config_change:
name: Detect and commit config changes
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Convert application.yml to ors-config.yml
run: |
.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
run: |
# Don't fail on exit code 1 (diff found)
set +e
git diff --exit-code --name-only ors-api/ors-config.yml
exit_value=$?
echo Found exit code $exit_value
# Write out the exit code using environment file
if [ $exit_value == 1 ]; then
echo "config_has_changed=true" >> $GITHUB_ENV
fi
- uses: MichaelsJP/git-auto-commit-action@v5
if: env.config_has_changed == 'true'
with:
commit_message: 'chore(config): automatic conversion of application.yml to ors-config.yml'

0 comments on commit 563ee79

Please sign in to comment.