Workflow file for this run
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 for Upstream Updates | ||
on: | ||
schedule: | ||
- cron: '0 0 * * 1' # Runs every Monday at midnight UTC | ||
workflow_dispatch: # Allows manual trigger from the Actions tab | ||
jobs: | ||
check-updates: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Git | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
- name: Clone your fork | ||
run: | | ||
git clone https://github.com/AndreHauschild/groops.git | ||
cd groops | ||
git remote add upstream https://github.com/groops-devs/groops.git | ||
git fetch upstream | ||
- name: Check for upstream changes | ||
id: check-updates | ||
run: | | ||
cd groops | ||
UPDATES=$(git log HEAD..upstream/main --oneline) | ||
echo "::set-output name=updates::$UPDATES" | ||
if [ -n "$UPDATES" ]; then | ||
echo "Updates found!" | ||
echo "$UPDATES" | ||
else | ||
echo "No updates found." | ||
fi | ||
- name: Notify about updates | ||
if: success() && steps.check-updates.outputs.updates != '' | ||
run: | | ||
echo "There are new changes in the upstream repository!" | mail -s "Upstream Updates" ${{ secrets.NOTIFY_EMAIL }} | ||
- name: Notify about no updates | ||
if: success() && steps.check-updates.outputs.updates == '' | ||
run: | | ||
..........echo "There are NO new changes in the upstream repository!" | mail -s "Upstream Updates" ${{ secrets.NOTIFY_EMAIL }} | ||