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

update github-issues.yml based on upstream #2

Merged
merged 1 commit into from
Sep 18, 2021
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
35 changes: 28 additions & 7 deletions .github/workflows/github-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ on:
schedule:
- name: 'daily'
cron: '0 0 * * *' # e.g. 5min */5 * * * *
- name: 'weekly'
cron: '59 23 * * 0'
- name: 'hacktoberfest-running'
cron: '0 0 * 10 *'
- name: 'hacktoberfest-over'
cron: '0 0 1 11 *'

repository_dispatch:
types:
- workflow-file-github-issues
Expand All @@ -76,6 +77,9 @@ jobs:
outputs:
user-issues-total: ${{ steps.set-from-github-graphql.outputs.totalCount }}
zen: ${{ steps.set-from-github-api.outputs.zen }}
issue-is-era: contains(github.event.issue.labels.*.name, 'hn/era')
issue-is-mile: contains(github.event.issue.labels.*.name, 'hn/mile')
issue-is-task: contains(github.event.issue.labels.*.name, 'hn/task')
steps:
# no pull request should trugger this job
- name: is pull request
Expand Down Expand Up @@ -146,6 +150,10 @@ jobs:
needs:
- issue
runs-on: ubuntu-latest
if: |
!needs.issue.outputs.issue-is-era &&
!needs.issue.outputs.issue-is-mile &&
!needs.issue.outputs.issue-is-task
outputs:
issue_url: ${{ github.event.issue.html_url }}
issue_comment: ${{ join(steps.*.outputs.value, '') }}
Expand Down Expand Up @@ -197,25 +205,36 @@ jobs:
- if: ${{ contains(toJSON(github.event), 'daily') }}
run: exit 1

# weekly schedule
weekly:
needs: schedule
if: github.event.schedule == '59 23 * * 0'
runs-on: ubuntu-latest
steps:
- if: ${{ contains(toJSON(github.event), 'weekly') }}
run: exit 1


hacktoberfest:
needs: schedule
if: |
github.event.schedule == '0 0 * 10 *' ||
github.event.schedule == '0 0 1 11 *' ||
github.event.schedule == '*/5 * * * *'

github.event.schedule == '0 0 1 11 *'
runs-on: ubuntu-latest
steps:
- uses: browniebroke/hacktoberfest-labeler-action@main
continue-on-error: true # topic error - GITHUB_TOKEN do not have permissions
with:
github_token: ${{ secrets.GITHUB_TOKEN }}


# should add remove labels
manage-labels:
needs:
- issue
if: |
!needs.issue.outputs.issue-is-era &&
!needs.issue.outputs.issue-is-mile &&
!needs.issue.outputs.issue-is-task
runs-on: ubuntu-latest
outputs:
add_labels: ${{ join(steps.*.outputs.add_labels, ',') }}
Expand All @@ -225,7 +244,9 @@ jobs:
steps:
- name: on open add labels
id: on-open-add-labels
if: github.event.action == 'opened' && !contains(github.event.issue.labels.*.name, 'triage')
if: |
github.event.action == 'opened' &&
!contains(github.event.issue.labels.*.name, 'triage')
run: echo "::set-output name=add_labels::triage"

- name: on potential question
Expand Down Expand Up @@ -363,7 +384,7 @@ jobs:
stale-issue-message: 'This issue has no activity for a while. It will be closed if no action is taken in near future'
close-issue-message: 'This issue was closed since there was no activity after it was marked stale.'
stale-issue-label: 'stale'
exempt-issue-labels: 'bug,security'
exempt-issue-labels: 'bug,security,hn/era,hn/mile,hn/task'
remove-issue-stale-when-updated: true
labels-to-add-when-unstale: 'triage'
exempt-all-issue-milestones: true
Expand Down