Skip to content

Commit 3ecb278

Browse files
committed
Revert "cancel run early if changelogs exists"
This reverts commit bd3f287.
1 parent bd3f287 commit 3ecb278

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

.github/workflows/changelog.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,7 @@ jobs:
1111
steps:
1212
- name: Get current date
1313
id: date
14-
run: |
15-
echo "TODAY=$(date +'%Y-%m-%d')" >> ${GITHUB_ENV}
16-
echo "LOG_FILES=fern/apis/*/changelog/$TODAY.md" >> ${GITHUB_ENV}
17-
- name: Check changelog
18-
run: |
19-
if ls $LOG_FILES >/dev/null 2>&1; then
20-
l=($LOG_FILES)
21-
echo "${l[@]} already exist."
22-
gh run cancel
23-
fi
14+
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
2415
- name: Check out repository content
2516
uses: actions/checkout@v2
2617
with:
@@ -44,26 +35,33 @@ jobs:
4435
base: 'base/fern/apis/public/openapi-public.yaml'
4536
revision: 'head/fern/apis/public/openapi-public.yaml'
4637
format: text
47-
output-to-file: 'temp/public/${{ env.TODAY }}_oasdiff.md'
38+
output-to-file: 'temp/public/${{ steps.date.outputs.date }}_oasdiff.md'
4839
- name: Running beta OpenAPI Spec diff action
4940
uses: oasdiff/oasdiff-action/diff@main
5041
with:
5142
base: 'base/fern/apis/beta/openapi-beta.yaml'
5243
revision: 'head/fern/apis/beta/openapi-beta.yaml'
5344
format: text
54-
output-to-file: 'temp/beta/${{ env.TODAY }}_oasdiff.md'
45+
output-to-file: 'temp/beta/${{ steps.date.outputs.date }}_oasdiff.md'
5546
- name: Archive changelogs
5647
uses: actions/upload-artifact@v4
5748
with:
58-
name: changelog-${{ env.TODAY }}
49+
name: changelog-${{ steps.date.outputs.date }}
5950
path: temp/**
6051
- name: Prompt
6152
env:
6253
LLM_JWT: ${{ secrets.LLM_JWT }}
6354
run: |
64-
python changelog.py --date ${{ env.TODAY }}
65-
git config user.name github-actions
66-
git config user.email [email protected]
67-
git add ${{ env.LOG_FILES }}
68-
git commit -m "generated by Claude"
69-
git push
55+
logfiles="fern/apis/*/changelog/${{ steps.date.outputs.date }}.md"
56+
57+
if ls $logfiles >/dev/null 2>&1; then
58+
logfiles=($logfiles)
59+
echo "${logfiles[@]} already exist."
60+
else
61+
python changelog.py --date ${{ steps.date.outputs.date }}
62+
git config user.name github-actions
63+
git config user.email [email protected]
64+
git add fern/apis/*/changelog/${{ steps.date.outputs.date }}.md
65+
git commit -m "generated by Claude"
66+
git push
67+
fi

0 commit comments

Comments
 (0)