-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow to regularly check for a new vroom release (#80)
- Loading branch information
Showing
1 changed file
with
53 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,53 @@ | ||
name: Check for new VROOM release | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check_tz: | ||
name: Check if VROOM has a new release we don't have yet | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run script | ||
shell: bash | ||
run: | | ||
set -e | ||
git config user.name 'github-actions[bot]' | ||
git config user.email 'github-actions[bot]@users.noreply.github.com' | ||
latest_vroom_tag="v1.15.0" #$(curl --silent -L -H "Accept: application/vnd.github+json" https://api.github.com/repos/VROOM-Project/vroom/tags | jq -r '.[0].name') | ||
latest_this_tag=$(git describe --tags --abbrev=0) | ||
# first check vroom | ||
if [[ $latest_vroom_tag == $latest_this_tag ]]; then | ||
"All up-to-date." | ||
exit 0 | ||
fi | ||
echo "New Vroom release available: ${latest_vroom_tag}" | ||
new_branch="gha-vroom-release-${latest_vroom_tag}" | ||
git checkout -b $new_branch | ||
# update the README | ||
sed -i "s/v1.14.0/v1.15.0/g" README.md | ||
# commit and push | ||
git commit -am "release ${latest_vroom_tag}" | ||
git push origin "${new_branch}" | ||
# open new PR | ||
body=$(echo -e "Update CHANGELOG with\n- [vroom](https://github.com/VROOM-Project/vroom/blob/master/CHANGELOG.md)\n- [vroom-express](https://github.com/VROOM-Project/vroom-express/blob/master/CHANGELOG.md)\n\nCreated by workflow run [#${WORKFLOW_RUN_ID}](https://github.com/valhalla/valhalla/actions/runs/${WORKFLOW_RUN_ID}).") | ||
gh pr create --base master --head $new_branch --title "New VROOM release ${latest_vroom_tag}" --body "${body}" | ||
exit 1 | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WORKFLOW_RUN_ID: ${{ github.run_id }} | ||
WORKFLOW_JOB_ID: ${{ github.job }} |