From e5f5a68f5c94ea3c452311a655f2be8eaad539b4 Mon Sep 17 00:00:00 2001 From: Maximilian Anzinger <44003963+MaximilianAnzinger@users.noreply.github.com> Date: Fri, 15 Nov 2024 02:16:57 +0100 Subject: [PATCH] Development: Create basic workflows (#2) --- .github/issue-labeler.yml | 6 ++++++ .github/pullrequest-labeler.yml | 11 ++++++++++ .github/workflows/issue-labeler.yml | 17 +++++++++++++++ .github/workflows/pullrequest-labeler.yml | 12 +++++++++++ .github/workflows/pullrequest-opened.yml | 13 ++++++++++++ .github/workflows/pullrequest-stale.yml | 26 +++++++++++++++++++++++ .github/workflows/validate-pr-title.yml | 15 +++++++++++++ 7 files changed, 100 insertions(+) create mode 100644 .github/issue-labeler.yml create mode 100644 .github/pullrequest-labeler.yml create mode 100644 .github/workflows/issue-labeler.yml create mode 100644 .github/workflows/pullrequest-labeler.yml create mode 100644 .github/workflows/pullrequest-opened.yml create mode 100644 .github/workflows/pullrequest-stale.yml create mode 100644 .github/workflows/validate-pr-title.yml diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml new file mode 100644 index 0000000..96a8e7a --- /dev/null +++ b/.github/issue-labeler.yml @@ -0,0 +1,6 @@ +docker: + - docker + +documentation: + - documentation + - docs \ No newline at end of file diff --git a/.github/pullrequest-labeler.yml b/.github/pullrequest-labeler.yml new file mode 100644 index 0000000..4bcfcb5 --- /dev/null +++ b/.github/pullrequest-labeler.yml @@ -0,0 +1,11 @@ +github: + - changed-files: + - any-glob-to-any-file: .github/**/* + +documentation: + - changed-files: + - any-glob-to-any-file: docs/**/* + +docker: + - changed-files: + - any-glob-to-any-file: docker/**/* \ No newline at end of file diff --git a/.github/workflows/issue-labeler.yml b/.github/workflows/issue-labeler.yml new file mode 100644 index 0000000..c2918dd --- /dev/null +++ b/.github/workflows/issue-labeler.yml @@ -0,0 +1,17 @@ +name: "Issue Labeler" +on: + issues: + types: [opened, edited] + +permissions: + issues: write + contents: read + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: MaximilianAnzinger/issue-labeler@1.0.1 + with: + configuration-path: .github/issue-labeler.yml + repo-token: ${{ github.token }} \ No newline at end of file diff --git a/.github/workflows/pullrequest-labeler.yml b/.github/workflows/pullrequest-labeler.yml new file mode 100644 index 0000000..9666eee --- /dev/null +++ b/.github/workflows/pullrequest-labeler.yml @@ -0,0 +1,12 @@ +name: Pull Request Labeler +on: [pull_request_target] + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/pullrequest-labeler.yml + sync-labels: true \ No newline at end of file diff --git a/.github/workflows/pullrequest-opened.yml b/.github/workflows/pullrequest-opened.yml new file mode 100644 index 0000000..cf00637 --- /dev/null +++ b/.github/workflows/pullrequest-opened.yml @@ -0,0 +1,13 @@ +name: Pull Request Opened +on: + pull_request_target: + types: [opened] + +jobs: + assign: + runs-on: ubuntu-latest + steps: + - name: Assign Pull Request to its Author + uses: technote-space/assign-author@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/pullrequest-stale.yml b/.github/workflows/pullrequest-stale.yml new file mode 100644 index 0000000..bbbd19f --- /dev/null +++ b/.github/workflows/pullrequest-stale.yml @@ -0,0 +1,26 @@ +name: Stale +on: + schedule: + - cron: "0 12 * * *" + +jobs: + stale: + if: github.repository_owner == 'ls1intum' + runs-on: ubuntu-latest + steps: + - name: Check for stale PRs + uses: actions/stale@v9 + with: + days-before-stale: 7 + days-before-close: 14 + # Disable issue checking, only PR + days-before-issue-stale: -1 + remove-stale-when-updated: true + stale-pr-label: "stale" + exempt-pr-labels: "no-stale" + labels-to-remove-when-stale: "ready for review, ready to merge" + stale-pr-message: > + There hasn't been any activity on this pull request recently. + Therefore, this pull request has been automatically marked as stale + and will be closed if no further activity occurs within **seven** days. + Thank you for your contributions. \ No newline at end of file diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml new file mode 100644 index 0000000..bd14243 --- /dev/null +++ b/.github/workflows/validate-pr-title.yml @@ -0,0 +1,15 @@ + +name: Validate PR Title + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review, edited] + +jobs: + validate-pr-title: + runs-on: ubuntu-latest + timeout-minutes: 1 + steps: + - uses: Slashgear/action-check-pr-title@v4.3.0 + with: + regexp: '^`(Development|General)`:\s[A-Z].*$' \ No newline at end of file