Skip to content

Commit

Permalink
Updated some files [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
hotio committed Sep 4, 2023
1 parent 243e659 commit 03fff3c
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,28 +299,36 @@ jobs:
runs-on: ubuntu-22.04
needs: [build, publish]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Git Config
env:
GITHUB_OWNER: ${{ github.repository_owner }}
run: |
git config --global user.email "${GITHUB_OWNER}@users.noreply.github.com"
git config --global user.name "${GITHUB_OWNER}"
- name: Update TAGS.json
- name: Update tags .json file
uses: nick-fields/retry@v2
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
REPO: ${{ github.repository }}
VERSION: ${{ needs.build.outputs.version }}
BRANCH: ${{ needs.build.outputs.branch }}
run: |
TAGS="${GITHUB_REF//refs\/heads\//}${BRANCH},${GITHUB_REF//refs\/heads\//}${BRANCH}-${VERSION},${GITHUB_REF//refs\/heads\//}${BRANCH}-${GITHUB_SHA:0:7}"
LAST_UPDATED=$(date -u +'%FT%T.%3NZ')
jq -n --arg last_updated "${LAST_UPDATED}" --arg tags "${TAGS}" '{ last_updated: $last_updated, tags: $tags | split(",") }' > TAGS.json
git add .
if git commit -m "Update TAGS.json [skip ci]"; then
git push
fi
with:
max_attempts: 3
retry_on: error
timeout_seconds: 20
command: |
TAGS="${GITHUB_REF//refs\/heads\//}${BRANCH},${GITHUB_REF//refs\/heads\//}${BRANCH}-${VERSION},${GITHUB_REF//refs\/heads\//}${BRANCH}-${GITHUB_SHA:0:7}"
LAST_UPDATED=$(date -u +'%FT%T.%3NZ')
git clone -b "master" "https://${GITHUB_TOKEN}@github.com/${REPO}.git" masterGit
cd "${GITHUB_WORKSPACE}/masterGit" || exit 1
jq -n --arg last_updated "${LAST_UPDATED}" --arg tags "${TAGS}" '{ last_updated: $last_updated, tags: $tags | split(",") }' > tags-${GITHUB_REF//refs\/heads\//}.json
git add .
if git commit -m "Update tags .json file [skip ci]"; then
git push
fi
cd "${GITHUB_WORKSPACE}" || exit 1
rm -rf "${GITHUB_WORKSPACE:?}/masterGit"
notify:
runs-on: ubuntu-22.04
Expand Down

0 comments on commit 03fff3c

Please sign in to comment.