-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2188 from sosiouxme/20241217-trt1107-github-app
TRT-1107: move neverstable cron script here for GH app auth
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
set -x | ||
set -o errexit | ||
set -o pipefail | ||
|
||
# This repo is assumed checked out in current directory | ||
git checkout -b update | ||
|
||
# Generate and push mapping | ||
OUTPUT=$(./scripts/update-neverstable.sh) | ||
|
||
if git diff --quiet | ||
then | ||
echo "No changes." | ||
exit 0 | ||
fi | ||
|
||
# get token with write ability (after slow work is done; do not give the token a chance to expire) | ||
keyfile="${GHAPP_KEYFILE:-/secrets/ghapp/private.key}" | ||
set +x | ||
trt_token=`gh-token generate --app-id 1046118 --key "$keyfile" --installation-id 57361690 --token-only` # 57361690 = openshift-trt | ||
git remote add openshift-trt "https://oauth2:${trt_token}@github.com/openshift-trt/sippy.git" | ||
set -x | ||
|
||
git commit -a -m "Update never-stable" | ||
git push openshift-trt update --force | ||
|
||
pr-creator -org openshift -repo sippy -source openshift-trt:update -branch master \ | ||
-github-app-private-key-path "${keyfile}" -github-app-id 1046118 \ | ||
-body "**Note: PLEASE REVIEW CHANGES BEFORE MERGING**<br><br>$OUTPUT" \ | ||
-title "Automated - Update never-stable" \ | ||
-confirm |