11
11
steps :
12
12
- name : Get current date
13
13
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')"
24
15
- name : Check out repository content
25
16
uses : actions/checkout@v2
26
17
with :
@@ -44,26 +35,33 @@ jobs:
44
35
base : ' base/fern/apis/public/openapi-public.yaml'
45
36
revision : ' head/fern/apis/public/openapi-public.yaml'
46
37
format : text
47
- output-to-file : ' temp/public/${{ env.TODAY }}_oasdiff.md'
38
+ output-to-file : ' temp/public/${{ steps.date.outputs.date }}_oasdiff.md'
48
39
- name : Running beta OpenAPI Spec diff action
49
40
uses : oasdiff/oasdiff-action/diff@main
50
41
with :
51
42
base : ' base/fern/apis/beta/openapi-beta.yaml'
52
43
revision : ' head/fern/apis/beta/openapi-beta.yaml'
53
44
format : text
54
- output-to-file : ' temp/beta/${{ env.TODAY }}_oasdiff.md'
45
+ output-to-file : ' temp/beta/${{ steps.date.outputs.date }}_oasdiff.md'
55
46
- name : Archive changelogs
56
47
uses : actions/upload-artifact@v4
57
48
with :
58
- name : changelog-${{ env.TODAY }}
49
+ name : changelog-${{ steps.date.outputs.date }}
59
50
path : temp/**
60
51
- name : Prompt
61
52
env :
62
53
LLM_JWT : ${{ secrets.LLM_JWT }}
63
54
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