-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump VERSION in certificate update PR (#57)
- Loading branch information
Showing
2 changed files
with
18 additions
and
5 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 |
---|---|---|
@@ -1,16 +1,29 @@ | ||
#!/bin/bash | ||
|
||
git config user.name "GitHub Actions" | ||
git config user.email "actions@users.noreply.github.com" | ||
function bump_version { | ||
awk -F. '{printf("%d.%d.%d\n", $1, $2, $3+1) >"VERSION"}' VERSION | ||
} | ||
|
||
function check_pr { | ||
gh pr list --state open --label "outdated check" | ||
} | ||
|
||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
git checkout outdated || git checkout -b outdated | ||
|
||
if ! mix certdata --check-outdated; then | ||
mix certdata | ||
|
||
if [[ $(check_pr) == "" ]]; then | ||
bump_version | ||
fi | ||
|
||
git add . | ||
git commit -m "Update certificates" | ||
git push --set-upstream origin outdated | ||
|
||
if [[ $(gh pr list --state open --label "outdated check") == "" ]]; then | ||
if [[ $(check_pr) == "" ]]; then | ||
gh pr create --fill --label "outdated check" | ||
fi | ||
fi |
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