Skip to content

Commit

Permalink
ci: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Aetherinox committed Aug 9, 2024
1 parent 949cfd0 commit a245f58
Show file tree
Hide file tree
Showing 4 changed files with 680 additions and 16 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/issues-accept.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# ---------------------------------------------------------------------------------------
# @parent : github workflow
# @desc : adds a label and assignee when specified user types /accept in
# PR comment.
# @author : Aetherinox
# @url : https://github.com/Aetherinox
# ---------------------------------------------------------------------------------------

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

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

on:
issue_comment:
types: [created]

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

env:
LABEL_ACCEPT: "Status 𐄂 Accepted"

ASSIGN_USER: Aetherinox
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
# ---------------------------------------------------------------------------------------

- 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 › ${{ 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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# - roadmap
# ---------------------------------------------------------------------------------------

name: "🎫 Issue › New › Assignment"
run-name: "🎫 Issue › New › Assignment - ${{ github.event.issue.number }}: ${{ github.event.issue.title }}"
name: "🎫 Issue › New"
run-name: "🎫 Issue › New › ${{ github.event.issue.number }}: ${{ github.event.issue.title }}"

# ---------------------------------------------------------------------------------------
# triggers
Expand Down Expand Up @@ -50,6 +50,7 @@ env:
ASSIGN_USER: Aetherinox
BOT_NAME_1: AdminServ
BOT_NAME_2: AdminServX
BOT_NAME_3: EuropaServ
BOT_NAME_DEPENDABOT: dependabot[bot]

LABELS_JSON: |
Expand Down Expand Up @@ -78,7 +79,7 @@ jobs:
steps:

- name: "✅ Start"
run: |
run: |
echo "Assigning labels and assignees"
- name: "☑️ Checkout"
Expand All @@ -89,7 +90,7 @@ jobs:
# ---------------------------------------------------------------------------------------
# Check if repo has labels currently added to issues
# ---------------------------------------------------------------------------------------

- name: 🏷️ Verify Existing Labels
uses: actions/github-script@v7
with:
Expand Down Expand Up @@ -157,7 +158,7 @@ jobs:
core.info( `Setting env issue title: ${ iss_title }` )
console.log( "\n\n" )
# ---------------------------------------------------------------------------------------
# Label > Bug
Expand Down Expand Up @@ -239,7 +240,7 @@ jobs:
/*
- Check if issue title matches the issue label "Bug:"
- Check if title contains word in words
- Check if title contains word in words
*/
if ( iss_title_lc.startsWith( bug_tag.toLowerCase( ) ) || bIncWordT || bFoundMatchTitle || bFoundMatchBody )
Expand All @@ -252,7 +253,7 @@ jobs:
console.log( "Already starts with " + road_tag + " ..... " + iss_title_lc.startsWith( road_tag.toLowerCase( ) ) )
add_labels.push( `${ bug_lbl }` );
console.log( `Adding Tag ....................... ${ bug_lbl }` )
console.log( "\n" )
Expand Down Expand Up @@ -285,7 +286,7 @@ jobs:
core.setOutput( 'issue_title', iss_title )
console.log( "\n\n" )
# ---------------------------------------------------------------------------------------
# Label > FEATURE
# ---------------------------------------------------------------------------------------
Expand Down Expand Up @@ -365,7 +366,7 @@ jobs:
/*
- Check if issue title matches the issue label "Feature:"
- Check if title contains word in words
- Check if title contains word in words
*/
// change TAG per category
Expand Down Expand Up @@ -494,7 +495,7 @@ jobs:
/*
- Check if issue title matches the issue label "Urgent:"
- Check if title contains word in words
- Check if title contains word in words
*/
// change TAG per category
Expand Down Expand Up @@ -625,7 +626,7 @@ jobs:
/*
- Check if issue title matches the issue label "Roadmap:"
- Check if title contains word in words
- Check if title contains word in words
*/
// change TAG per category
Expand Down Expand Up @@ -691,7 +692,7 @@ jobs:
environment:
name: Orion
steps:

# ---------------------------------------------------------------------------------------
# checkout
# ---------------------------------------------------------------------------------------
Expand Down Expand Up @@ -778,7 +779,7 @@ jobs:
message.push ( HE_message );
bHasMessage = true;
}
/*
Bot has message to send
*/
Expand Down Expand Up @@ -835,4 +836,3 @@ jobs:
core.setFailed( error.message );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# @url : https://github.com/Aetherinox
# ---------------------------------------------------------------------------------------

name: "⚡ PRAutoscan"
run-name: "⚡ PRAutoscan"
name: "🎫 IssuesScan"
run-name: "🎫 IssuesScan"

# ---------------------------------------------------------------------------------------
# triggers
Expand Down
Loading

0 comments on commit a245f58

Please sign in to comment.