Skip to content

Commit

Permalink
Commit and push updated EdFi.Ods.CodeGen package reference
Browse files Browse the repository at this point in the history
  • Loading branch information
semalaiappan committed Sep 26, 2024
1 parent 0b886bc commit 401c922
Showing 1 changed file with 19 additions and 36 deletions.
55 changes: 19 additions & 36 deletions .github/workflows/Rebuild Database Templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ jobs:
contents: write

steps:

- name: Checkout the Repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0w
- name: Extract StandardVersion
id: extract_version
run: echo "standard_version=${{ fromJson(needs.FindStandardAndExtensionVersions.outputs.StandardVersions)[0] }}" >> $GITHUB_ENV
Expand Down Expand Up @@ -264,22 +267,6 @@ jobs:
repo: Ed-Fi-Alliance-OSS/Ed-Fi-ODS
check_artifacts: true

- name: Import GPG key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@82a020f1f7f605c65dd2449b392a52c3fcfef7ef # v6.0.0
with:
workdir: ./Ed-Fi-ODS-Implementation/
gpg_private_key: ${{ secrets.EDFIBUILDAGENT_PRIVATE_KEY }}
passphrase: ${{ secrets.EDFIBUILDAGENT_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true

- name: Git setup
working-directory: ./Ed-Fi-ODS-Implementation/
run: |
git config user.name "${{ steps.import-gpg.outputs.name }}"
git config user.email "${{ steps.import-gpg.outputs.email }}"
- name: Update configuration.packages.json with EdFi.Ods.CodeGen new package version
if: ${{ env.NoNewCommitsInAllThreeRepositories == 'false' || (env.NoNewCommitsInAllThreeRepositories == 'true' && env.EdFi.Ods.CodeGen_package_alreadyupdated == 'false') }}
working-directory: ./Ed-Fi-ODS-Implementation/
Expand All @@ -296,26 +283,22 @@ jobs:
$config.packages.'EdFi.Ods.CodeGen'.PackageVersion = $packageversion
$config | ConvertTo-Json | Format-Json | Out-File -FilePath $filePath -Encoding UTF8
- name: Commit and push updated EdFi.Ods.CodeGen package reference
working-directory: ./Ed-Fi-ODS-Implementation/
shell: pwsh
run: |
# Define the file path
$filePath = "./configuration.packages.json"
# Check if there are any changes in the file
git diff --quiet $filePath
$changesDetected = $LASTEXITCODE -eq 1
- name: Check Git status
working-directory: ./Ed-Fi-ODS-Implementation/
run: |
git status
git add .
if ($changesDetected) {
Write-Host "Changes detected in configuration.packages.json. Committing and pushing."
git add $filePath
git commit -m "Updating for new CodeGen version"
git push -u origin $env:current_branch
} else {
Write-Host "No changes detected in configuration.packages.json. Skipping commit."
}
exit 0
- name: Commit and push updated EdFi.Ods.CodeGen package reference
uses: planetscale/ghcommit-action@4131649dbf2fdf1eb34421702972a5af7b0a8731 #v0.1.18
with:
commit_message: "Updating for new CodeGen version"
repo: ${{ github.repository }}
branch: ${{ env.current_branch }}
empty: false
path: Ed-Fi-ODS-Implementation/
env:
GITHUB_TOKEN: ${{ secrets.REPO_DISPATCH_TOKEN }}
- name: Check if any successful workflow run in Pkg EdFi.Ods.Extensions.Homograph.yml
working-directory: ./Ed-Fi-ODS-Implementation/
if: ${{ env.NoNewCommitsInAllThreeRepositories == 'true' }}
Expand Down

0 comments on commit 401c922

Please sign in to comment.