Skip to content

Commit

Permalink
Update pipeline to move tag to main
Browse files Browse the repository at this point in the history
  • Loading branch information
igoravl committed Oct 13, 2024
1 parent 4ed791c commit 395b565
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ env:
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -18,6 +20,7 @@ jobs:
Build:

runs-on: windows-latest
if: github.event_name == 'pull_request'
env:
TFSCMDLETS_ACCESS_TOKEN: ${{ secrets.TFSCMDLETS_TOKEN }}
TFSCMDLETS_COLLECTION_URL: 'https://dev.azure.com/tfscmdlets'
Expand Down Expand Up @@ -337,3 +340,23 @@ jobs:
# with:
# status: |
# TfsCmdlets version ${{ env.BUILD_NAME }} has just been released. Check it out! https://github.com/igoravl/TfsCmdlets/releases/tag/v${{ env.RELEASE_TAG }}

PostRelease:

runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update tag
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
if [[ "$COMMIT_MESSAGE" =~ \(\#[0-9]+\)$ ]]; then
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
git tag -d $LATEST_TAG
git tag $LATEST_TAG $GITHUB_SHA
git push origin :refs/tags/$LATEST_TAG
git push origin $LATEST_TAG
fi

0 comments on commit 395b565

Please sign in to comment.