Update "data" Tag on Every Commit to Main #66
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update "data" Tag on Every Commit to Main | |
| on: | |
| workflow_run: | |
| workflows: ["Validate JSON"] | |
| types: | |
| - completed | |
| permissions: | |
| contents: write | |
| jobs: | |
| update-data-tag: | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "[email protected]" | |
| - name: Delete remote tag "data" if exists | |
| run: | | |
| git push origin :refs/tags/data || true | |
| - name: Delete local tag "data" if exists | |
| run: | | |
| git tag -d data || true | |
| - name: Create new tag "data" pointing to latest commit | |
| run: | | |
| git tag data | |
| - name: Push tag "data" to origin (force) | |
| run: | | |
| git push origin refs/tags/data --force |