Skip to content

Commit

Permalink
feat(monorepo): Added various workflows to the repository
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Sep 16, 2024
1 parent 55ef55a commit 1c8661e
Show file tree
Hide file tree
Showing 8 changed files with 321 additions and 7 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
required: false
push:
branches:
- "main"
- "canary"
- "experimental"
- main
- canary
- experimental

jobs:
start:
Expand All @@ -19,7 +19,7 @@ jobs:
permissions:
contents: write
id-token: write
if: startsWith(github.repository, 'storm-software/') && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/canary' || github.ref == 'refs/heads/experimental')
if: github.repository == 'storm-software/cyclone-ui' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/canary' || github.ref == 'refs/heads/experimental')
steps:
- name: Send notification - Deployment started
uses: storm-software/action-notify@main
Expand Down Expand Up @@ -63,7 +63,9 @@ jobs:
- name: Setup workspace
uses: storm-software/action-setup@main
with:
package-manager: pnpm
package-manager-version: 9.10.0
storm-bot: Stormie-Bot
storm-bot-github-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}

- name: Build Cyclone-UI Nx-Plugin packages
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/cleanowners.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Weekly codeowners cleanup
on:
workflow_dispatch:
schedule:
- cron: "3 2 1 * *"

permissions:
contents: read

jobs:
cleanowners:
name: cleanowners
runs-on: ubuntu-latest
permissions:
issues: write

steps:
- name: Run cleanowners action
uses: github/cleanowners@v1
env:
GH_TOKEN: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
ORGANIZATION: storm-software
11 changes: 8 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ name: "CodeQL"

on:
push:
branches: ["main"]
branches:
- main
- canary
- experimental
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
branches:
- main
- canary
- experimental
schedule:
- cron: "37 16 * * 6"

Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Monthly contributor report
on:
workflow_dispatch:
schedule:
- cron: "3 2 1 * *"

permissions:
issues: write

jobs:
contributor_report:
name: contributor report
runs-on: ubuntu-latest
steps:
- name: Get dates for last month
shell: bash
run: |
# Calculate the first day of the previous month
start_date=$(date -d "last month" +%Y-%m-01)
# Calculate the last day of the previous month
end_date=$(date -d "$start_date +1 month -1 day" +%Y-%m-%d)
#Set an environment variable with the date range
echo "START_DATE=$start_date" >> "$GITHUB_ENV"
echo "END_DATE=$end_date" >> "$GITHUB_ENV"
- name: Run contributor action
uses: github/contributors@v1
env:
GH_TOKEN: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
START_DATE: ${{ env.START_DATE }}
END_DATE: ${{ env.END_DATE }}
REPOSITORY: storm-software/cyclone-ui

- name: Create issue
uses: peter-evans/create-issue-from-file@v5
with:
title: Thank you Storm-Ops contributors (${{ env.START_DATE }}..${{
env.END_DATE }})
token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
content-filepath: ./contributors.md
31 changes: 31 additions & 0 deletions .github/workflows/dependabot-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Dependabot Update

on:
pull_request:
types:
- opened
- synchronize
branches:
- dependabot

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: "${{secrets.STORM_BOT_GITHUB_TOKEN}}"
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.STORM_BOT_GITHUB_TOKEN }}"

- name: Approve Dependabot PRs
uses: storm-software/action-dependabot-approve@main
2 changes: 2 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
push:
branches:
- main
- canary
- experimental
paths:
- .github/labels.yml

Expand Down
178 changes: 178 additions & 0 deletions .github/workflows/schedule-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
on:
schedule:
- cron: "0 0 * * *"

name: Stale Bot workflow

permissions:
issues: write

jobs:
build:
if: ${{ github.repository_owner == 'storm-software' }}
permissions:
issues: write # to close stale issues (actions/stale)
pull-requests: write # to close stale PRs (actions/stale)

name: stale
runs-on: ubuntu-latest
steps:
- name: stale-more-info-needed
id: stale-more-info-needed
uses: actions/[email protected]
with:
repo-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
days-before-stale: 14
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "blocked: more info needed"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Storm Software community! 🙏
- name: stale-needs-rebase
id: stale-needs-rebase
uses: actions/[email protected]
with:
repo-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
days-before-stale: 14
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "blocked: needs rebased"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Storm Software community! 🙏
- name: stale-repro-needed
id: stale-repro-needed
uses: actions/[email protected]
with:
repo-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
days-before-stale: 14
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "blocked: repro needed"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Storm Software community! 🙏
- name: stale-retry-with-latest
id: stale-retry-with-latest
uses: actions/[email protected]
with:
repo-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
days-before-stale: 14
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "blocked: retry with latest"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Storm Software community! 🙏
- name: stale-bug
id: stale-bug
uses: actions/[email protected]
with:
repo-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
days-before-stale: 180
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: bug"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Storm Software community! 🙏
- name: stale-cleanup
id: stale-cleanup
uses: actions/[email protected]
with:
repo-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
days-before-stale: 180
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: cleanup"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Storm Software community! 🙏
- name: stale-docs
id: stale-docs
uses: actions/[email protected]
with:
repo-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
days-before-stale: 180
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: docs"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Storm Software community! 🙏
- name: stale-enhancement
id: stale-enhancement
uses: actions/[email protected]
with:
repo-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
days-before-stale: 250
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: enhancement"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Storm Software community! 🙏
- name: stale-feature
id: stale-feature
uses: actions/[email protected]
with:
repo-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
days-before-stale: 250
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: feature"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Storm Software community! 🙏
- name: stale-question
id: stale-question
uses: actions/[email protected]
with:
repo-token: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}
days-before-stale: 45
days-before-close: 14
stale-issue-label: "stale"
operations-per-run: 300
remove-stale-when-updated: true
only-labels: "type: question / discussion"
stale-issue-message: |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Storm Software community! 🙏
31 changes: 31 additions & 0 deletions .github/workflows/sync-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Sync labels

on:
push:
branches:
- main
- canary
- experimental
paths:
- .github/labels.yml

env:
CI: true
NX_DAEMON: false
NX_VERBOSE_LOGGING: true
SKIP_ENV_VALIDATION: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
labels:
name: ♻️ Sync labels
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/checkout@v4
- name: 🚀 Run Label Syncer
uses: micnncim/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.STORM_BOT_GITHUB_TOKEN }}

0 comments on commit 1c8661e

Please sign in to comment.