Skip to content

Commit

Permalink
Change Issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
offensive-vk authored Sep 4, 2024
1 parent a19452b commit ddc251a
Showing 1 changed file with 6 additions and 139 deletions.
145 changes: 6 additions & 139 deletions .github/workflows/auto-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get Branch Info
id: branch-info
run: |
echo "BASE_REF=$(git symbolic-ref --short HEAD)" >> $GITHUB_ENV
echo "HEAD_REF=$(git symbolic-ref --short HEAD)" >> $GITHUB_ENV

- name: Create or Open A PR
id: create-pr
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.BOT_TOKEN }}
destination_branch: "classic"
pr_title: "${{ github.workflow }} - (${{ github.event.head_commit.message }})"
pr_title: "Hamster Left A Pull Request - (${{ github.event.head_commit.message }})"
pr_body: "Details are on their way... - says Hamster."
pr_reviewer: "offensive-vk"
pr_label: "bot,automated,hamster,pull-request"
Expand Down Expand Up @@ -79,7 +74,7 @@ jobs:
create_issue_on_success:
runs-on: ubuntu-latest
needs: create_pr
if: github.event_name != 'push'
if: github.event_name == 'pull_request' && github.event.pull_request.state != 'open'
steps:
- name: Create Issue using Bot
uses: dacbd/create-issue-action@main
Expand All @@ -88,7 +83,7 @@ jobs:
title: |
${{ github.workflow }} - PR Created Successfully
assignees: TheHamsterBot
labels: automated,bot
labels: automated,bot,hamster,issue
body: |
## Pull Request Created Successfully:
Expand All @@ -102,7 +97,7 @@ jobs:
create_issue_on_failure:
runs-on: ubuntu-latest
needs: create_pr
if: github.event_name != 'push' && failure()
if: github.event_name != 'push' && failure() && github.event.pull_request.state == 'open'
steps:
- name: Create Failure Issue
uses: dacbd/create-issue-action@main
Expand All @@ -111,7 +106,7 @@ jobs:
title: |
${{ github.workflow }} - PR Creation Failed
assignees: TheHamsterBot
labels: automated,bot
labels: automated,bot,hamster,issue
body: |
## Pull Request Creation Failed:
Expand All @@ -123,132 +118,4 @@ jobs:
- Branch: ${{ github.ref }}
- Commit: ${{ github.sha }}
- Workflow Path: ${{ github.workflow }}
- Error: ${{ job.status }}
# name: CI / Automated Pull Request

# on:
# push:
# branches-ignore:
# - "classic"
# workflow_dispatch:
# schedule:
# - cron: '0 */1 * * *'

# jobs:
# create_pr:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Get Branch Info
# id: branch-info
# run: |
# echo "BASE_REF=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
# echo "HEAD_REF=$(git rev-parse --abbrev-ref origin/HEAD)" >> $GITHUB_ENV

# - name: Create or Open A PR
# id: create-pr
# uses: repo-sync/pull-request@v2
# with:
# github_token: ${{ secrets.BOT_TOKEN }}
# destination_branch: "classic"
# pr_title: "${{ github.workflow }} - (${{ github.event.head_commit.message }})"
# pr_body: "Details are on their way... - says Hamster."
# pr_reviewer: "offensive-vk"
# pr_label: "bot,automated,hamster,pull-request"
# pr_assignee: "TheHamsterBot"
# pr_draft: false

# - name: Save PR Number in ENV
# run: echo "PR_NUMBER=${{ steps.create-pr.outputs.number }}" >> $GITHUB_ENV

# update_pr:
# needs: create_pr
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Generate Pull Request Template
# run: |
# timestamp=$(date '+%b %d, %A %I:%M:%S %p')
# markdown=$(cat <<EOF
# ## This Pull Request Was Automated by [Hamster [bot]](https://github.com/TheHamsterBot)

# > [!NOTE]
# > Workflow Trigger: ${{ github.event_name }} event at ${{ env.HEAD_REF }} branch.
# > Details of Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

# - Author: @TheHamsterBot
# - Branch: ${{ env.BASE_REF }} (base) / ${{ env.HEAD_REF }} (head)
# - Commit: ${{ github.sha }}
# - Workflow Path: ${{ github.workflow }}
# - Pull Request Number: #${{ env.PR_NUMBER }}
# - Pusher Details: ${{ github.event.issue.user.id }} <${{ github.event.pusher.email }}>

# ---

# Thanks.
# $timestamp
# Your Hamster 🐹 <code>PR90XPOMFW68FM</code>
# EOF)
# echo "$markdown" > .github/Auto_Pull_Request.md
# echo "MARKDOWN_CONTENT<<EOF" >> $GITHUB_ENV
# echo "$markdown" >> $GITHUB_ENV
# echo "EOF" >> $GITHUB_ENV

# - name: Update Pull Request Body
# run: |
# gh pr edit "$PR_NUMBER" --body "$MARKDOWN_CONTENT"
# continue-on-error: true
# env:
# GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}

# create_issue_on_success:
# runs-on: ubuntu-latest
# needs: create_pr
# if: success()
# steps:
# - name: Create Issue using Bot
# uses: dacbd/create-issue-action@main
# with:
# token: ${{ secrets.BOT_TOKEN }}
# title: |
# ${{ github.workflow }} - PR Created Successfully
# assignees: TheHamsterBot
# labels: automated,bot
# body: |
# ## Pull Requeste Created Successfully:

# - Author: @TheHamsterBot
# - PR URL: ${{ steps.open-pr.outputs.pull-request-url }}
# - Branch: ${{ github.ref }}
# - Commit: ${{ github.sha }}
# - Workflow Path: ${{ github.workflow_ref }}
# - Branch: ${{ github.base_ref }} (base) / ${{ github.head_ref }} (head)
# - Pull Request Number: #${{ github.event.number }}
# - Pull Request Title: ${{ github.event.pull_request.title }}

# create_issue_on_failure:
# runs-on: ubuntu-latest
# needs: create_pr
# if: failure()
# steps:
# - name: Create Failure Issue
# uses: dacbd/create-issue-action@main
# with:
# token: ${{ secrets.BOT_TOKEN }}
# title: |
# ${{ github.workflow }} - PR Creation Failed
# assignees: TheHamsterBot
# labels: automated,bot
# body: |
# ## Pull Request Creation Failed:

# > [!WARNING]
# > Workflow Trigger: ${{ github.event_name }} event at ${{ github.event.base_ref }} branch.
# > Details of Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

# - Author: @TheHamsterBot
# - Branch: ${{ github.ref }}
# - Commit: ${{ github.sha }}
# - Workflow Path: ${{ github.workflow_ref }}
# - Error: ${{ job.status }}
- Error: ${{ job.status }}

0 comments on commit ddc251a

Please sign in to comment.