update git clone counter workflow

pull/39/head
Ciro 2022-11-26 08:08:22 -03:00
rodzic 5751cfe93a
commit a1f34bbe85
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -28,12 +28,12 @@ jobs:
if gh secret list | grep -q "GIST_ID"
then
echo "GIST_ID found"
echo ::set-output name=GIST::${{ secrets.GIST_ID }}
curl https://gist.githubusercontent.com/${{ github.actor }}/${{ secrets.GIST_ID }}/raw/clone.json > clone_before.json
echo ::set-output name=GIST::${{ secrets.CLONE_GIST_ID }}
curl https://gist.githubusercontent.com/${{ github.actor }}/${{ secrets.CLONE_GIST_ID }}/raw/clone.json > clone_before.json
if cat clone_before.json | grep '404: Not Found'; then
echo "GIST_ID not valid anymore. Creating another gist..."
gist_id=$(gh gist create clone.json | awk -F / '{print $NF}')
echo $gist_id | gh secret set GIST_ID
echo $gist_id | gh secret set CLONE_GIST_ID
echo ::set-output name=GIST::$gist_id
cp clone.json clone_before.json
git rm --ignore-unmatch CLONE.md
@ -87,4 +87,4 @@ jobs:
- name: Push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_token: ${{ secrets.BUILDTOKEN }}