Skip to content

Commit fbe5fb9

Browse files
committed
create a milestone badge
1 parent 413cdde commit fbe5fb9

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Update Milestone Badge
2+
3+
on:
4+
milestone:
5+
types: [created, edited, closed, deleted]
6+
schedule:
7+
- cron: '0 6 * * *' # Daily at 6am UTC
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
update-badge:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout docs branch
18+
uses: actions/checkout@v4
19+
with:
20+
ref: docs
21+
fetch-depth: 1
22+
23+
- name: Fetch nearest milestone and generate badge
24+
env:
25+
GH_TOKEN: ${{ github.token }}
26+
run: |
27+
# Get the nearest open milestone sorted by due date
28+
MILESTONE=$(gh api repos/${{ github.repository }}/milestones \
29+
--jq 'sort_by(.due_on) | map(select(.state == "open" and .due_on != null)) | first')
30+
31+
LABEL="Next Milestone"
32+
if [ -z "$MILESTONE" ] || [ "$MILESTONE" = "null" ]; then
33+
MESSAGE="No milestone"
34+
COLOR="lightgrey"
35+
else
36+
TITLE=$(echo "$MILESTONE" | jq -r '.title')
37+
# URL-encode the title for shields.io
38+
MESSAGE=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$TITLE', safe=''))")
39+
COLOR="blue"
40+
fi
41+
42+
mkdir -p milestone
43+
curl -s "https://img.shields.io/badge/${LABEL}-${MESSAGE}-${COLOR}" -o milestone/badge.svg
44+
45+
- name: Commit and push
46+
run: |
47+
git config user.name "github-actions[bot]"
48+
git config user.email "github-actions[bot]@users.noreply.github.com"
49+
git add milestone/badge.svg
50+
git diff --cached --quiet && echo "No changes" && exit 0
51+
git commit -m "chore: update milestone badge"
52+
git push

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
[![E2E Tests](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/e2e-tests.yml/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/e2e-tests.yml)
1010
[![CodeQL](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/github-code-scanning/codeql)
1111
[![Spotless](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/check-spotless.yml/badge.svg)](https://github.com/aws/aws-durable-execution-sdk-java/actions/workflows/check-spotless.yml)
12+
[![Roadmap](https://raw.githubusercontent.com/aws/aws-durable-execution-sdk-java/refs/heads/docs/milestone/badge.svg)](https://github.com/orgs/aws/projects/346/views/6)
1213

1314
Build resilient, long-running AWS Lambda functions that automatically checkpoint progress and resume after failures. Durable functions can run for up to one year while you pay only for active compute time.
1415

0 commit comments

Comments
 (0)