Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/update-milestone-badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Update Milestone Badge

on:
milestone:
types: [created, edited, closed, deleted]
schedule:
- cron: '0 6 * * *'
workflow_dispatch:

permissions:
contents: write

jobs:
update-badge:
runs-on: ubuntu-latest
steps:
- name: Checkout docs branch
uses: actions/checkout@v4
with:
ref: docs
fetch-depth: 1

- name: Fetch nearest milestone and generate badge
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail

# Fetch open milestones with due dates, pick the nearest one
TITLE=$(gh api repos/${{ github.repository }}/milestones \
--jq '[.[] | select(.state == "open" and .due_on != null)] | sort_by(.due_on) | .[0].title // empty')

if [ -z "$TITLE" ]; then
URL="https://img.shields.io/badge/Next%20Milestone-No%20milestone-lightgrey"
else
# URL-encode the title using jq, then escape dashes for shields.io
ENCODED=$(echo -n "$TITLE" | jq -sRr @uri | sed 's/-/--/g')
URL="https://img.shields.io/badge/Next%20Milestone-${ENCODED}-blue"
fi

mkdir -p milestone
curl -sfL "$URL" -o milestone/badge.svg
echo "Badge generated for: ${TITLE:-No milestone}"

- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add milestone/badge.svg
git diff --cached --quiet && echo "No changes" && exit 0
git commit -m "chore: update milestone badge"
git push
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[![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)
[![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)
[![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)
[![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)

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.

Expand Down
Loading