Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix take action #299

Merged
merged 1 commit into from
Oct 1, 2024
Merged
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
36 changes: 22 additions & 14 deletions .github/workflows/take.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
name: Auto-assign issue to contributor

on:
issue_comment:
types: [created]

jobs:
assign:
name: Take an issue
runs-on: ubuntu-latest
permissions:
issues: write
if: ${{ github.event.created_at >= format('{0}-10-01T00:00:00Z', github.event.created_at.substr(0,4)) && github.event.created_at <= format('{0}-10-31T23:59:59Z', github.event.created_at.substr(0,4)) }}
steps:
- name: take the issue
uses: bdougie/take-action@1439165ac45a7461c2d89a59952cd7d941964b87
with:
message: Thanks for taking this issue! Let us know if you have any questions!
trigger: .take
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check if it's October
id: check-month
run: |
current_month=$(date -u +%m)
if [[ $current_month == "10" ]]; then
echo "is_october=true" >> $GITHUB_OUTPUT
else
echo "is_october=false" >> $GITHUB_OUTPUT
fi

log_out_of_october:
name: Log when outside October
runs-on: ubuntu-latest
if: ${{ !(github.event.created_at >= format('{0}-10-01T00:00:00Z', github.event.created_at.substr(0,4)) && github.event.created_at <= format('{0}-10-31T23:59:59Z', github.event.created_at.substr(0,4))) }}
steps:
- name: Log skipped action
run: echo "Action skipped because the current date is not in October."
- name: Take the issue
if: steps.check-month.outputs.is_october == 'true'
uses: bdougie/take-action@1439165ac45a7461c2d89a59952cd7d941964b87
with:
message: Thanks for taking this issue! Let us know if you have any questions!
trigger: .take
token: ${{ secrets.GITHUB_TOKEN }}

- name: Log when outside October
if: steps.check-month.outputs.is_october == 'false'
run: echo "Action skipped because the current date is not in October."