modified workflow to report issues #13
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
name: Check and Pull Upstream Updates | |
on: | |
push: | |
branches: [ "main" ] | |
schedule: | |
- cron: '0 0 * * *' # Runs each day UTC midnight | |
workflow_dispatch: | |
jobs: | |
update-upstream: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fetch upstream | |
run: | | |
git remote add upstream https://github.com/HimaxWiseEyePlus/Seeed_Grove_Vision_AI_Module_V2.git | |
git fetch upstream | |
- name: Check for updates | |
id: check_updates | |
run: | | |
git merge-base --is-ancestor upstream/main main && echo "status=up_to_date" >> $GITHUB_OUTPUT || echo "status=needs_update" >> $GITHUB_OUTPUT | |
echo "Current commit: $(git rev-parse HEAD)" | |
echo "Upstream commit: $(git rev-parse upstream/main)" | |
- name: Create Pull Request | |
if: steps.check_updates.outputs.status == 'needs_update' | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: Update from upstream repository | |
title: Automated Update from Upstream | |
body: | | |
This is an automated pull request to update from the upstream repository. | |
Please review the changes and merge if appropriate. | |
branch: automated-upstream-update | |
base: main | |
labels: automated,upstream-update | |
reviewers: | | |
acutetech | |
Tobyntobyn | |
victor-wildlife | |
draft: false | |
- name: Check Pull Request | |
if: steps.check_updates.outputs.status == 'needs_update' | |
run: | | |
echo "Pull request created or updated" | |
- name: No updates needed | |
if: steps.check_updates.outputs.status == 'up_to_date' | |
run: | | |
echo "Already up to date with upstream." |