forked from Artificial-Pancreas/iAPS
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ env: | |
UPSTREAM_REPO: mountrcg/iAPS | ||
UPSTREAM_BRANCH: ${{ github.ref_name }} # branch on upstream repository to sync from (replace with specific branch name if needed) | ||
TARGET_BRANCH: ${{ github.ref_name }} # target branch on fork to be kept in sync, and target branch on upstream to be kept alive (replace with specific branch name if needed) | ||
ALIVE_BRANCH: alive | ||
ALIVE_BRANCH: autoISF | ||
|
||
jobs: | ||
validate: | ||
|
@@ -69,21 +69,21 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
# Get ref for Artificial-Pancreas/iAPS:main | ||
# Get ref for mountrcg/iAPS:main | ||
SHA=$(curl -sS https://api.github.com/repos/${{ env.UPSTREAM_REPO }}/git/refs \ | ||
| jq '.[] | select(.ref == "refs/heads/main" ) | .object.sha' \ | ||
| tr -d '"' | ||
); | ||
# Create alive branch based on Artificial-Pancreas/iAPS:dev | ||
# Create alive branch based on mountrcg/iAPS:dev | ||
gh api \ | ||
--method POST \ | ||
-H "Authorization: token $GITHUB_TOKEN" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
/repos/${{ github.repository_owner }}/iAPS/git/refs \ | ||
-f ref='refs/heads/alive' \ | ||
-f sha=$SHA | ||
# Performs keepalive to avoid stale fork | ||
check_latest_from_upstream: | ||
needs: [validate, check_alive_and_permissions] | ||
|
@@ -101,7 +101,7 @@ jobs: | |
with: | ||
token: ${{ secrets.GH_PAT }} | ||
ref: alive | ||
|
||
# Keep repository "alive": add empty commits to ALIVE_BRANCH after "time_elapsed" days of inactivity to avoid inactivation of scheduled workflows | ||
- name: Keep alive | ||
if: | | ||
|
@@ -116,7 +116,7 @@ jobs: | |
run: | | ||
echo "### :calendar: Scheduled Sync and Build Disabled :mobile_phone_off:" >> $GITHUB_STEP_SUMMARY | ||
echo "You have not yet configured the scheduled sync and build for iAPS's browser build." >> $GITHUB_STEP_SUMMARY | ||
echo "Synchronizing your fork of <code>iAPS</code> with the upstream repository <code>Artificial-Pancreas/iAPS</code> will be skipped." >> $GITHUB_STEP_SUMMARY | ||
echo "Synchronizing your fork of <code>iAPS</code> with the upstream repository <code>mountrcg/iAPS</code> will be skipped." >> $GITHUB_STEP_SUMMARY | ||
echo "If you want to enable automatic builds and updates for your iAPS, please follow the instructions \ | ||
under the following path <code>iAPS/fastlane/testflight.md</code>." >> $GITHUB_STEP_SUMMARY | ||
|
@@ -151,7 +151,7 @@ jobs: | |
- name: Sync upstream changes | ||
if: | # do not run the upstream sync action on the upstream repository | ||
needs.check_alive_and_permissions.outputs.WORKFLOW_PERMISSION == 'true' && | ||
vars.SCHEDULED_SYNC == 'true' && github.repository_owner != 'Artificial-Pancreas' | ||
vars.SCHEDULED_SYNC == 'true' && github.repository_owner != 'mountrcg' | ||
id: sync | ||
uses: aormsby/[email protected] | ||
with: | ||
|
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