Skip to content

[autocommit] Updating version.properties #94

[autocommit] Updating version.properties

[autocommit] Updating version.properties #94

name: Release Drafter
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- name: Checkout code
if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Get version
if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
id: version
run: echo ::set-output name=version::$(echo $(sed -nE "s/\"version\":(.*),/\1/p" package.json))
# Drafts your next Release notes as Pull Requests are merged into "master"
- name: Update Draft
if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
id: update_draft
uses: release-drafter/release-drafter@v5
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
config-name: release-drafter.yml
name: ${{ steps.version.outputs.version }}
tag: ${{ steps.version.outputs.version }}
version: ${{ steps.version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Update version
# if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
# run: 'sed -i -E "s/\"version\": .*,/\"version\": \"${{steps.update_draft.outputs.name}}\",/" package.json'
- name: Update version info
if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
run: 'sed -i -E "s~\"versionInfo\": \".*~\"versionInfo\": \"https://github.com/Breeding-Insight/bi-web/releases/tag/${{ steps.update_draft.outputs.tag_name }}\"~" package.json'
- name: Commit files
if: github.event_name == 'push' && github.actor != 'rob-ouser-bi'
run: |
git config --local user.email "[email protected]"
git config --local user.name "rob-ouser-bi"
git remote set-url origin https://x-access-token:${{ secrets.ROB_OUSER_TOKEN }}@github.com/${{ github.repository }}
git commit -am "[autocommit] Updating version.properties" && git push || echo "No changes to commit"