Skip to content

Commit 62b0f66

Browse files
authored
Merge pull request #30 from code2docs-ai/ups216/update-created-at-field
Update created_at field to use current time in workflow
2 parents 2e9d6fb + e866aa8 commit 62b0f66

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/create-repo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
if [ ! -f workflow_runs.json ]; then
5454
echo "[]" > workflow_runs.json
5555
fi
56-
workflow_run=$(jq -n --arg id "${{ github.run_id }}" --arg repoUrl "${{ github.event.inputs.repoUrl }}" --arg branchName "${{ github.event.inputs.branchName }}" --arg docs_repo_name "${{ env.docs_repo_name }}" --arg status "${{ job.status }}" --arg conclusion "${{ job.conclusion }}" --arg created_at "${{ github.event.created_at }}" '{id: $id, repoUrl: $repoUrl, branchName: $branchName, docs_repo_name: $docs_repo_name, status: $status, conclusion: $conclusion, created_at: $created_at}')
56+
workflow_run=$(jq -n --arg id "${{ github.run_id }}" --arg repoUrl "${{ github.event.inputs.repoUrl }}" --arg branchName "${{ github.event.inputs.branchName }}" --arg docs_repo_name "${{ env.docs_repo_name }}" --arg status "${{ job.status }}" --arg conclusion "${{ job.conclusion }}" --arg created_at "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" '{id: $id, repoUrl: $repoUrl, branchName: $branchName, docs_repo_name: $docs_repo_name, status: $status, conclusion: $conclusion, created_at: $created_at}')
5757
jq ". += [$workflow_run]" workflow_runs.json > tmp.json && mv tmp.json workflow_runs.json
5858
git config --global user.email "[email protected]"
5959
git config --global user.name "code2docs-ai agent"

workflow_runs.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"docs_repo_name": "smartcode-workshops_auto-suggest-java",
77
"status": "success",
88
"conclusion": "",
9-
"created_at": ""
9+
"created_at": "2023-09-25T12:34:56Z"
1010
},
1111
{
1212
"id": "13103514155",
@@ -15,6 +15,6 @@
1515
"docs_repo_name": "smartcode-workshops_auto-suggest-java",
1616
"status": "success",
1717
"conclusion": "",
18-
"created_at": ""
18+
"created_at": "2023-09-25T12:34:56Z"
1919
}
2020
]

0 commit comments

Comments
 (0)