From bb25389a71254c0664ea340d41db628b4c6bf44e Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Wed, 8 Sep 2021 20:10:54 +0100 Subject: [PATCH] :kaaba: Adds actions for managing PRs, issues and comments --- .github/workflows/add-comment-from-tag.yml | 27 +++++++++++++++++++++ .github/workflows/auto-tag-pr.yml | 17 +++++++++++++ .github/workflows/raise-issue-from-todo.yml | 13 ++++++++++ .github/workflows/update-issue-after-pr.yml | 11 +++++++++ 4 files changed, 68 insertions(+) create mode 100644 .github/workflows/add-comment-from-tag.yml create mode 100644 .github/workflows/auto-tag-pr.yml create mode 100644 .github/workflows/raise-issue-from-todo.yml create mode 100644 .github/workflows/update-issue-after-pr.yml diff --git a/.github/workflows/add-comment-from-tag.yml b/.github/workflows/add-comment-from-tag.yml new file mode 100644 index 00000000..7aa0da03 --- /dev/null +++ b/.github/workflows/add-comment-from-tag.yml @@ -0,0 +1,27 @@ +# Based on a label applied to an issue, the bot will add a comment with some additional info +name: Post Status from Label +on: + issues: + types: + - labeled + - unlabeled + pull_request_target: + types: + - labeled + - unlabeled +permissions: + contents: read + issues: write + pull-requests: write + +jobs: + comment: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Label Commenter + uses: peaceiris/actions-label-commenter@v1 + with: + github_token: ${{ secrets.BOT_GITHUB_TOKEN }} + config_file: ./path_to/your_config.yml diff --git a/.github/workflows/auto-tag-pr.yml b/.github/workflows/auto-tag-pr.yml new file mode 100644 index 00000000..7d5ddcef --- /dev/null +++ b/.github/workflows/auto-tag-pr.yml @@ -0,0 +1,17 @@ +# Creates a new tag, whenever the app version (in package.json) is updated in master +name: Create Tag +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: butlerlogic/action-autotag@stable + with: + tag_prefix: v + strategy: package + GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} + commit_message_template: "🔖 {{number}} {{message}} (by {{author}})\nSHA: {{sha}}\n." \ No newline at end of file diff --git a/.github/workflows/raise-issue-from-todo.yml b/.github/workflows/raise-issue-from-todo.yml new file mode 100644 index 00000000..e7fe5b7a --- /dev/null +++ b/.github/workflows/raise-issue-from-todo.yml @@ -0,0 +1,13 @@ +# Finds any TODO notes within the code, and opens up an issue for it to be fixed +name: Open issue for Todos +on: ["push"] +jobs: + build: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@master" + - name: "TODO to Issue" + uses: "alstr/todo-to-issue-action@v4.2" + id: "todo" + with: + TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/update-issue-after-pr.yml b/.github/workflows/update-issue-after-pr.yml new file mode 100644 index 00000000..e62678fc --- /dev/null +++ b/.github/workflows/update-issue-after-pr.yml @@ -0,0 +1,11 @@ +# After a PR is merged, the linked issue will be updated with a comment, based on commit message +name: Update Issue After PR +on: push +jobs: + checkCommit: + name: Comment From Commit + runs-on: ubuntu-latest + steps: + - uses: adamzolyak/commit-issue-commenter-action@master + env: + GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} \ No newline at end of file