Skip to content

Commit

Permalink
ci: update issues-* workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetherinox committed Oct 7, 2024
1 parent 155c700 commit b077b14
Show file tree
Hide file tree
Showing 6 changed files with 1,780 additions and 1,593 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/auto-assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Auto Assign

on:
issues:
types: [opened]
pull_request:
types: [opened]

jobs:
run:
runs-on: ubuntu-latest

permissions:
issues: write
pull-requests: write

steps:
- name: Auto-assign issue
uses: pozil/auto-assign-issue@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
assignees: Aetherinox
numOfAssignee: 1
91 changes: 47 additions & 44 deletions .github/workflows/issues-accept.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,70 @@
# ---------------------------------------------------------------------------------------
# #
# @parent : github workflow
# @desc : adds a label and assignee when specified user types /accept in
# PR comment.
# @desc : adds a label to a PR when the command "/accept" is typed in the issue comments
# @author : Aetherinox
# @url : https://github.com/Aetherinox
# ---------------------------------------------------------------------------------------
# #

name: "🎫 Issue › Accept"
run-name: "🎫 Issue › Accept"

# ---------------------------------------------------------------------------------------
# #
# triggers
# ---------------------------------------------------------------------------------------
# #

on:
issue_comment:
types: [created]
issue_comment:
types: [created]

# ---------------------------------------------------------------------------------------
# #
# environment variables
# ---------------------------------------------------------------------------------------
# #

env:
LABEL_ACCEPT: "Status 𐄂 Accepted"
LABEL_ACCEPT: "Status 𐄂 Accepted"

ASSIGN_USER: Aetherinox
BOT_NAME_1: AdminServ
BOT_NAME_2: AdminServX
BOT_NAME_3: EuropaServ
BOT_NAME_DEPENDABOT: dependabot[bot]
BOT_NAME_1: AdminServ
BOT_NAME_2: AdminServX
BOT_NAME_3: EuropaServ
BOT_NAME_DEPENDABOT: dependabot[bot]

# ---------------------------------------------------------------------------------------
# #
# jobs
#
# env not available for job.if
# ---------------------------------------------------------------------------------------
# #

jobs:
deploy:
runs-on: ubuntu-latest
if: github.event.issue.pull_request && contains(github.event.comment.body, '/accept') && github.event.comment.user.login == 'Aetherinox'
steps:

# ---------------------------------------------------------------------------------------
# Add Label to accepted PR
# ---------------------------------------------------------------------------------------
# #
# Job [ Deploy ]
# #

- name: "🏷️ Assign Label › ${{ env.LABEL_ACCEPT }}"
run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: ${{ env.LABEL_ACCEPT }}
deploy:
runs-on: ubuntu-latest
if: github.event.issue.pull_request && contains(github.event.comment.body, '/accept') && github.event.comment.user.login == ${{ github.repository_owner }}
steps:

# ---------------------------------------------------------------------------------------
# Add assignee to accepted PR
# ---------------------------------------------------------------------------------------
# #
# Add Label to accepted PR
# #

- name: "🏷️ Assign Assignee › ${{ env.ASSIGN_USER }}"
run: gh issue edit "$NUMBER" --add-assignee "$ASSIGNEE"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
ASSIGNEE: ${{ env.ASSIGN_USER }}
- name: >-
🏷️ Assign Label › ${{ env.LABEL_ACCEPT }}
run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: ${{ env.LABEL_ACCEPT }}
# #
# Add assignee to accepted PR
# #

- name: >-
🏷️ Assign Assignee › ${{ github.repository_owner }}
run: gh issue edit "$NUMBER" --add-assignee "$ASSIGNEE"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
ASSIGNEE: ${{ github.repository_owner }}
Loading

0 comments on commit b077b14

Please sign in to comment.