build(ci): cleanup CI workflows
[e-mobility-charging-stations-simulator.git] / .github / workflows / clone-count.yml
index 8ae1af0873a10b4249e115f1486b5621115a2c27..3df9887135c6e25a9bb6d9831f23ffd1a1c3501c 100644 (file)
@@ -10,7 +10,7 @@ jobs:
     runs-on: ubuntu-latest
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
 
       - name: gh login
         run: echo "${{ secrets.SECRET_TOKEN }}" | gh auth login --with-token
@@ -28,21 +28,21 @@ jobs:
           if gh secret list | grep -q "GIST_ID"
           then
               echo "GIST_ID found"
-              echo ::set-output name=GIST::${{ secrets.GIST_ID }}
+              echo "GIST=${{ secrets.GIST_ID }}" >> $GITHUB_OUTPUT
               curl https://gist.githubusercontent.com/${{ github.actor }}/${{ secrets.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 ::set-output name=GIST::$gist_id
+                echo "GIST=${gist_id}" >> $GITHUB_OUTPUT
                 cp clone.json clone_before.json
-                git rm --ignore-unmatch  CLONE.md
+                git rm --ignore-unmatch CLONE.md
               fi
           else
               echo "GIST_ID not found. Creating a gist..."
               gist_id=$(gh gist create clone.json | awk -F / '{print $NF}')
               echo $gist_id | gh secret set GIST_ID
-              echo ::set-output name=GIST::$gist_id
+              echo "GIST=${gist_id}" >> $GITHUB_OUTPUT
               cp clone.json clone_before.json
           fi
 
@@ -85,6 +85,6 @@ jobs:
           fi
 
       - name: Push
-        uses: ad-m/github-push-action@master
+        uses: CasperWA/push-protected@v2
         with:
-          github_token: ${{ secrets.GITHUB_TOKEN }}
+          token: ${{ secrets.SECRET_TOKEN }}