From 9bc50886bb58c535c56cc6430b86e9e61bee7568 Mon Sep 17 00:00:00 2001 From: Chip Senkbeil Date: Thu, 6 Jul 2023 00:55:38 -0500 Subject: [PATCH] Update latest tagging with custom code that uses a personal access token to trigger workflows --- .github/workflows/latest.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latest.yml b/.github/workflows/latest.yml index 904b208..d68b952 100644 --- a/.github/workflows/latest.yml +++ b/.github/workflows/latest.yml @@ -10,5 +10,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Run latest-tag - uses: EndBug/latest-tag@latest + - name: Tag latest and push + env: + GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + run: | + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" + + origin_url="$(git config --get remote.origin.url)" + origin_url="${origin_url/#https:\/\//https:\/\/$GITHUB_TOKEN@}" # add token to URL + + git tag latest --force + git push "$origin_url" --tags --force