Skip to content

Merge pull request #4548 from hmislk/Issue#4547 #10

Merge pull request #4548 from hmislk/Issue#4547

Merge pull request #4548 from hmislk/Issue#4547 #10

Workflow file for this run

name: Update Version and README
on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]:

Check failure on line 6 in .github/workflows/create_version.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create_version.yml

Invalid workflow file

You have an error in your yaml syntax on line 6
jobs:
update_version_and_readme:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Determine current date
id: current_date
run: echo "::set-output name=date::$(date +'%Y%m%d')"
- name: Read merge counter from file
id: read_counter
run: echo "::set-output name=counter::$(cat counter.txt || echo '0')"
- name: Increment merge counter
id: increment_counter
run: |
counter=$((${{ steps.read_counter.outputs.counter }} + 1))
echo "::set-output name=counter::$counter"
- name: Update version file with date and merge counter
run: echo "3.0.0.${{ steps.current_date.outputs.date }}.${{ steps.increment_counter.outputs.counter }}" > VERSION.txt
- name: Update README.md
run: |
sed -i "s/Current Version:.*/Current Version: 3.0.0.${{ steps.current_date.outputs.date }}.${{ steps.increment_counter.outputs.counter }} (This line will be automatically updated to reflect the latest version)/" README.md
- name: Set up Git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Action"
- name: Commit version and README update
run: |
git add VERSION.txt README.md
git commit -m "Update version to 3.0.0.${{ steps.current_date.outputs.date }}.${{ steps.increment_counter.outputs.counter }}"
git push