-
Notifications
You must be signed in to change notification settings - Fork 460
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Merging Dev changes to Main (#1530)
Co-authored-by: Ajit Padhi <[email protected]>
- Loading branch information
1 parent
9483a06
commit 1ae5e9c
Showing
15 changed files
with
1,105 additions
and
563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ on: | |
push: | ||
branches: | ||
- main | ||
- dev | ||
- demo | ||
schedule: | ||
- cron: '0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT | ||
|
||
|
@@ -34,6 +36,17 @@ jobs: | |
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set imageTag | ||
id: set-image-tag | ||
run: | | ||
if [[ "${{ github.event_name }}" == "schedule" ]]; then | ||
echo "imageTag=latest" >> $GITHUB_ENV | ||
elif [[ "${{ github.ref_name }}" == "main" ]]; then | ||
echo "imageTag=latest" >> $GITHUB_ENV | ||
else | ||
echo "imageTag=${{ github.ref_name }}" >> $GITHUB_ENV | ||
fi | ||
- name: Pre-build image and run make in dev container | ||
uses: devcontainers/[email protected] | ||
env: | ||
|
@@ -43,8 +56,9 @@ jobs: | |
with: | ||
imageName: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator | ||
cacheFrom: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator | ||
imageTag: ${{ env.imageTag }} | ||
runCmd: make ci && make deploy | ||
refFilterForPush: refs/heads/main | ||
refFilterForPush: refs/heads/${{ github.event_name == 'schedule' && 'main' || github.ref_name }} | ||
env: | | ||
AZURE_CLIENT_ID | ||
AZURE_CLIENT_SECRET | ||
|
@@ -64,6 +78,7 @@ jobs: | |
with: | ||
push: never | ||
imageName: ghcr.io/azure-samples/chat-with-your-data-solution-accelerator | ||
imageTag: ${{ env.imageTag }} | ||
runCmd: make destroy | ||
env: | | ||
AZURE_CLIENT_ID | ||
|
@@ -78,7 +93,6 @@ jobs: | |
if: failure() | ||
run: | | ||
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
# Construct the email body | ||
EMAIL_BODY=$(cat <<EOF | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Sync Main to dependabotchanges | ||
|
||
on: | ||
# Schedule the sync job to run daily or customize as needed | ||
schedule: | ||
- cron: '0 1 * * *' # Runs every day at 1 AM UTC | ||
# Trigger the sync job on pushes to the main branch | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetch all history for accurate branch comparison | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "github-actions[bot]" | ||
git config user.email "github-actions[bot]@users.noreply.github.com" | ||
- name: Sync main to dependabotchanges | ||
run: | | ||
# Ensure we're on the main branch | ||
git checkout main | ||
# Fetch the latest changes | ||
git pull origin main | ||
# Switch to dependabotchanges branch | ||
git checkout dependabotchanges | ||
# Merge main branch changes | ||
git merge main --no-edit | ||
# Push changes back to dependabotchanges branch | ||
git push origin dependabotchanges | ||
- name: Notify on Failure | ||
if: failure() | ||
run: echo "Sync from main to dependabotchanges failed!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
metadata description = 'Creates a SQL role assignment under an Azure Cosmos DB account.' | ||
param accountName string | ||
|
||
param roleDefinitionId string | ||
param principalId string = '' | ||
|
||
resource role 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { | ||
parent: cosmos | ||
name: guid(roleDefinitionId, principalId, cosmos.id) | ||
properties: { | ||
principalId: principalId | ||
roleDefinitionId: roleDefinitionId | ||
scope: cosmos.id | ||
} | ||
} | ||
|
||
resource cosmos 'Microsoft.DocumentDB/databaseAccounts@2022-08-15' existing = { | ||
name: accountName | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.