Skip to content

Commit

Permalink
github action bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ImreKertesz committed Nov 15, 2023
1 parent b9067eb commit 404d6d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/clone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ jobs:
if gh secret list | grep -q "GIST_ID"
then
echo "GIST_ID found"
echo GIST=${{ secrets.GIST_ID }} >> $GITHUB_OUTPUT
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
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 GIST=$gist_id >> $GITHUB_OUTPUT
echo "GIST=$gist_id" >> $GITHUB_OUTPUT
cp clone.json clone_before.json
fi
Expand Down

0 comments on commit 404d6d0

Please sign in to comment.