diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 0000000..d991339 --- /dev/null +++ b/.github/workflows/version.yml @@ -0,0 +1,29 @@ +name: Version bump +on: + release: + types: [published] + +jobs: + openapi: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + repository: 'https://github.com/snypy/snypy-docker' + token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }} + + - name: Update env file + run: | + cat .env + export $(cat .env | xargs) + export API_VERSION=${{ github.event.release.tag_name }} + envsubst < .env.template > .env + cat .env + + - name: Create commit + run: | + git config --global user.name "Continuous Integration" + git config --global user.email "username@users.noreply.github.com" + git add .env + git commit -m "Bump API_VERSION to ${{ github.event.release.tag_name }}" + git push