Skip to content

Commit 4361dad

Browse files
authored
feat: add pushups check github action (#9)
* feat: add pushups check github action * add workflow pushups check
1 parent 2e4fb03 commit 4361dad

3 files changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Pushup Check
2+
on: [pull_request]
3+
4+
jobs:
5+
pushups:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: higgins/gitpushups.com/pushups-action@main

pushups-action/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Check Git Pushups Action
2+
3+
This composite GitHub Action verifies whether the author of a pull request has completed their daily pushups using the [GitPushups API](https://api.gitpushups.com).
4+
If the user has not done their pushups for the current day, the action fails the workflow.
5+
6+
## Usage
7+
8+
```yaml
9+
name: Pushup Check
10+
on: [pull_request]
11+
12+
jobs:
13+
pushups:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: higgins/gitpushups.com/pushups-action@main
18+
```

pushups-action/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: 'Check Git Pushups'
2+
description: 'Fails if the pull request author has not completed their daily pushups.'
3+
author: 'GitPushups'
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Verify pushups
8+
shell: bash
9+
run: |
10+
AUTHOR="${{ github.event.pull_request.user.login }}"
11+
echo "Checking pushups for $AUTHOR"
12+
TODAY=$(date -u +%F)
13+
RESULT=$(curl -fsSL "https://api.gitpushups.com/user/${AUTHOR}?local_date=${TODAY}" | jq -r '.didPushupsToday')
14+
if [[ "$RESULT" != "true" ]]; then
15+
echo "::error::$AUTHOR has not done pushups for $TODAY"
16+
exit 1
17+
fi
18+
echo "$AUTHOR has completed their pushups for $TODAY"

0 commit comments

Comments
 (0)