Skip to content

Update gradle.properties #3

Update gradle.properties

Update gradle.properties #3

# GitHub Actions Workflow responsible for template-clean like updating CLA contract url. This workflow is supposed to be triggered automatically
# when a new template-based repository has been created.
name: Template Clean Up
on:
push:
jobs:
# Run cleaning process only if workflow is triggered by the non micronaut-project/micronaut-opensearch repository.
template-cleanup:
name: Template Cleanup
runs-on: ubuntu-latest
if: github.event.repository.name != 'micronaut-opensearch'
steps:
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
# Cleanup project
- name: Cleanup
run: |
# Update CLA url in CONTRIBUTING.md
sed -i "s|micronaut-projects/micronaut-opensearch|$GITHUB_REPOSITORY|" CONTRIBUTING.md
sed -i "s|opensearch|${GITHUB_REPOSITORY:29}|" README.md
sed -i "s|opensearch|${GITHUB_REPOSITORY:29}|" gradle.properties
sed -i "s|opensearch|${GITHUB_REPOSITORY:29}|" CONTRIBUTING.md
sed -i "s|opensearch|${GITHUB_REPOSITORY:29}|" MAINTAINING.md
sed -i "s|micronaut-projects/micronaut-opensearch|$GITHUB_REPOSITORY|" SECURITY.md
sed -i "s|opensearch|${GITHUB_REPOSITORY:29}|" opensearch/build.gradle
sed -i "s|opensearch|${GITHUB_REPOSITORY:29}|" opensearch-bom/build.gradle
sed -i "s|opensearch|${GITHUB_REPOSITORY:29}|" buildSrc/src/main/groovy/io.micronaut.build.internal.opensearch-module.gradle
git mv opensearch/ "micronaut-${GITHUB_REPOSITORY:29}/"
git mv opensearch-bom/ "micronaut-${GITHUB_REPOSITORY:29}-bom/"
git mv buildSrc/src/main/groovy/io.micronaut.build.internal.opensearch-module.gradle "buildSrc/src/main/groovy/io.micronaut.build.internal.${GITHUB_REPOSITORY:29}-module.gradle"
git mv buildSrc/src/main/groovy/io.micronaut.build.internal.opensearch-base.gradle "buildSrc/src/main/groovy/io.micronaut.build.internal.${GITHUB_REPOSITORY:29}-base.gradle"
# Remove clean up template
rm -rf .github/workflows/template-cleanup.yml
# Commit modified files
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Template cleanup"
# Push changes
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}