Currently I have the following GitHub workflow for tagging nightly snapshots on the master branch of a repository:
name: Nightly Snapshot
on:
schedule:
- cron: "0 0 * * *"
jobs:
tag:
name: Tag
runs-on: linux-latest
steps:
- name: Checkout master branch
uses: actions/checkout@v2
with:
ref: 'master'
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Tag snapshot
uses: tvdias/github-tagger@v0.0.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.date.outputs.date }}
However, there aren't always new commits to the master branch. I want to modify the workflow to only create new tags if there are new commits after when the latest tag was created. How should I do it?