Skip to content

Commit 95591fd

Browse files
Share timestamp between workflow steps (#13)
* Initial plan * Complete Update Issue created-at time step and share timestamp between steps Co-authored-by: hesreallyhim <172150522+hesreallyhim@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: hesreallyhim <172150522+hesreallyhim@users.noreply.github.com>
1 parent 0780c0d commit 95591fd

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/update-nonce.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,18 @@ jobs:
3333
token: ${{ secrets.GITHUB_TOKEN }}
3434

3535
- name: Update Issue created-at time
36+
if: steps.check-nonce.outputs.contains_nonce == 'true'
37+
id: update-timestamp
3638
run: |
37-
# Update the "Last Issue create at" time
39+
# Update the "Last Issue created at" time
3840
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
41+
echo "timestamp=$TIMESTAMP" >> $GITHUB_OUTPUT
42+
echo "Generated timestamp: $TIMESTAMP"
3943
40-
44+
# Update the timestamp in the baseline section
45+
sed -i 's/Last Issue created at: `[^`]*`/Last Issue created at: `'"$TIMESTAMP"'`/g' README.md
46+
echo "Updated README.md with new timestamp in baseline section"
47+
4148
4249
- name: Update nonce in README
4350
if: steps.check-nonce.outputs.contains_nonce == 'true'
@@ -46,9 +53,9 @@ jobs:
4653
NEW_NONCE=$(printf "%06d" $((RANDOM % 1000000)))
4754
echo "Generated new nonce: $NEW_NONCE"
4855
49-
# Get current timestamp in UTC
50-
TIMESTAMP=$(date -u +"%Y-%m-%d %H:%M:%S UTC")
51-
echo "Current timestamp: $TIMESTAMP"
56+
# Reuse timestamp from previous step
57+
TIMESTAMP="${{ steps.update-timestamp.outputs.timestamp }}"
58+
echo "Using timestamp from previous step: $TIMESTAMP"
5259
5360
# Find and replace nonce=NNNNNN pattern with new nonce
5461
# Only within the NONCE section markers

0 commit comments

Comments
 (0)