From e533b6b20384e0004c302047d60a804948a0ad4e Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sun, 16 Aug 2020 05:58:41 +0200 Subject: [PATCH] :tada: Add example action --- .github/workflows/badges.yml | 21 +++++++++++++++++++++ README.md | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/badges.yml diff --git a/.github/workflows/badges.yml b/.github/workflows/badges.yml new file mode 100644 index 0000000..7be35da --- /dev/null +++ b/.github/workflows/badges.yml @@ -0,0 +1,21 @@ +name: Badges + +on: [push] + +jobs: + answer-badge: + name: Create Answer Badge + runs-on: ubuntu-latest + steps: + - name: Get the Numbers + run: echo "::set-env name=ANSWER::42" + - name: Create the Badge + uses: schneegans/dynamic-badges-action@master + with: + auth: ${{ secrets.GIST_SECRET }} + gistID: + filename: answer.json + label: The Answer is + message: ${{ env.ANSWER }} + color: green + diff --git a/README.md b/README.md index 9aac8f5..b61bba6 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Gist Parameter | Description A common usage pattern of this action is to create environment variables in previous steps of a job and later use them as message in your badge. This can be achieved like this: ```yml -- name: Calculate the Number +- name: Get the Numbers run: echo "::set-env name=ANSWER::42" - name: Create the Badge uses: schneegans/dynamic-badges-action@v1 @@ -94,7 +94,7 @@ A common usage pattern of this action is to create environment variables in prev filename: answer.json label: The Answer is message: ${{ env.ANSWER }} - color: purple + color: green ``` # Contributing to Dynamic Badges Action