Update calver.yml
This commit is contained in:
22
.github/workflows/calver.yml
vendored
22
.github/workflows/calver.yml
vendored
@@ -10,7 +10,6 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -18,6 +17,7 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set Calver Version
|
- name: Set Calver Version
|
||||||
uses: Nelyx/action-calver@v1.0.0
|
uses: Nelyx/action-calver@v1.0.0
|
||||||
id: setcalver
|
id: setcalver
|
||||||
@@ -25,14 +25,24 @@ jobs:
|
|||||||
default_branch: 'refs/heads/main'
|
default_branch: 'refs/heads/main'
|
||||||
format: 'YYYY.M.D'
|
format: 'YYYY.M.D'
|
||||||
version_prefix: ''
|
version_prefix: ''
|
||||||
|
|
||||||
- name: Update version file
|
- name: Update version file
|
||||||
run: |
|
run: |
|
||||||
sed -i "s/subgen_version =.*/subgen_version = '${{ steps.setcalver.outputs.package_version }}'/" subgen.py
|
sed -i "s/subgen_version =.*/subgen_version = '${{ steps.setcalver.outputs.package_version }}'/" subgen.py
|
||||||
|
|
||||||
- name: Commit and push changes
|
- name: Amend commit with version update
|
||||||
|
env:
|
||||||
|
GIT_AUTHOR_NAME: "McCloudS"
|
||||||
|
GIT_AUTHOR_EMAIL: "scott@mccloud.dev"
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "GitHub Actions"
|
git config user.name "${GIT_AUTHOR_NAME}"
|
||||||
git config --global user.email "actions@github.com"
|
git config user.email "${GIT_AUTHOR_EMAIL}"
|
||||||
|
|
||||||
|
# Stage the modified file
|
||||||
git add subgen.py
|
git add subgen.py
|
||||||
git commit -m "Automated update subgen.py with version"
|
|
||||||
git push
|
# Amend the most recent commit, reusing the previous commit message
|
||||||
|
git commit --amend --reuse-message=HEAD --author="${GIT_AUTHOR_NAME} <${GIT_AUTHOR_EMAIL}>"
|
||||||
|
|
||||||
|
# Push the amended commit
|
||||||
|
git push --force
|
||||||
|
|||||||
Reference in New Issue
Block a user