Skip to content

Commit 8efc9e8

Browse files
authored
add automated version bump workflow (#4)
1 parent 213cd64 commit 8efc9e8

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
3+
name: Update Atlantis Version
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: 0 0 * * *
9+
10+
jobs:
11+
scheduled:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
16+
- name: Check out repo
17+
uses: actions/checkout@v2
18+
19+
- name: Try update Atlantis version
20+
run: |
21+
latest_release=$(curl -s https://api.github.com/repos/runatlantis/atlantis/releases/latest | jq '.tag_name')
22+
echo "latest_release=$latest_release" >> $GITHUB_ENV
23+
sed -i "s/ARG ATLANTIS_VERSION=.*/ARG ATLANTIS_VERSION=$latest_release/g" Dockerfile
24+
25+
- name: Check for a clean git directory
26+
continue-on-error: true
27+
run: |
28+
if [ -z "$(git status --porcelain)" ]; then
29+
exit 1
30+
fi
31+
32+
- name: Create Pull Request
33+
if: ${{ failure() }}
34+
uses: peter-evans/create-pull-request@v4
35+
with:
36+
branch: atlantis/${{ env.latest_release }}
37+
title: atlantis ${{ env.latest_release }}

0 commit comments

Comments
 (0)