Skip to content

Commit

Permalink
Update sync-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPeck committed Oct 11, 2024
1 parent c87bac1 commit 354c9b0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/sync-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch the full history
fetch-depth: 0 # Fetch the full history

- name: Set up Git
run: |
Expand All @@ -36,7 +36,7 @@ jobs:
exit 1
- name: Reset release branch to main
if: steps.diff-check.outcome == 'success' # Only proceed if no differences found
if: steps.diff-check.outcome == 'success' # Only proceed if no differences found
run: |
git reset --hard origin/main
Expand All @@ -45,14 +45,13 @@ jobs:
run: git push origin release --force

- name: Notify via GitHub Issue if differences found
if: failure() # This runs if there were differences found and the job failed
if: failure() # This runs if there were differences found and the job failed
uses: actions/github-script@v6
with:
script: |
const github = require('@actions/github');
await github.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Sync Failure: Differences found between main and release',
body: 'There are differences between `main` and `release` branches that prevented synchronization. Please review the branches and resolve manually.'
});
});

0 comments on commit 354c9b0

Please sign in to comment.