diff --git a/.github/workflows/github-issues.yml b/.github/workflows/github-issues.yml index 0bd0a18..77cd182 100644 --- a/.github/workflows/github-issues.yml +++ b/.github/workflows/github-issues.yml @@ -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 @@ -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 @@ -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, '') }} @@ -197,13 +205,21 @@ 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 @@ -211,11 +227,14 @@ jobs: 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, ',') }} @@ -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 @@ -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