Skip to content

Commit

Permalink
🪲 Fix existence check
Browse files Browse the repository at this point in the history
  • Loading branch information
Schneegans committed Oct 7, 2023
1 parent c88b03b commit cd7ee4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/badges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Create the Badge
uses: schneegans/dynamic-badges-action@v1.6.0
uses: schneegans/dynamic-badges-action@master
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 2ab8f1d386f13aaebccbd87dac94068d
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ try {
console.log("Old gist:");
console.log(oldGist);

if (oldGist?.body?.files?.[filename]) {
const oldContent = oldGist.body.files[filename].content;
if (oldGist?.files?.[filename]) {
const oldContent = oldGist.files[filename].content;

console.log(`Old content: ${oldContent}`);
console.log(`New content: ${content}`);
Expand All @@ -201,7 +201,7 @@ try {
}

if (shouldUpdate) {
if (oldGist?.body?.files?.[filename]) {
if (oldGist?.files?.[filename]) {
console.log(`Content changed, updating gist at ${filename}.`);
} else {
console.log(`Content didn't exist, creating gist at ${filename}.`);
Expand Down

0 comments on commit cd7ee4c

Please sign in to comment.