Skip to content

Commit

Permalink
Major Bug Fixes and Enhancements. (#31)
Browse files Browse the repository at this point in the history
Co-authored-by: Vedansh <[email protected]>
  • Loading branch information
TheHamsterBot and offensive-vk authored Oct 27, 2024
1 parent 311155c commit c156e1c
Show file tree
Hide file tree
Showing 11 changed files with 332 additions and 325 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: CI / Build & Test

on:
schedule:
- cron: "0 */4 * * *"
- cron: "0 0 * * *"
push:
branches: ["master", "**"]
branches: ["master"]
pull_request:
branches: ["master", "**"]
branches: ["master"]
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -81,9 +81,10 @@ jobs:
- run: pnpm run build

job_summary:
name: Send Summary
needs: [on_linux, on_windows, on_macos]
continue-on-error: false
runs-on: ubuntu-latest
steps:
- name: Job Summary
run: echo "🎉 The job was successful."
run: echo "🎉 The job was successful." >> $GITHUB_STEP_SUMMARY;
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
tags:
- '*'
schedule:
- cron: '0 0 1 * *'
- cron: '0 0 * * 0'
workflow_dispatch:

env:
Expand Down Expand Up @@ -48,9 +48,10 @@ jobs:
type=ref,event=pr
type=edge
latest
${{ github.ref_name }}
labels: |
org.opencontainers.image.title=auto-issue
org.opencontainers.image.description=Automated Issue Creator Github Action
org.opencontainers.image.description=Create Automated Issue using Github Action
org.opencontainers.image.vendor=Vedansh
- name: Verify Tags and Labels
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI / Test

on:
schedule:
- cron: '0 0 * * *'
- cron: '0 0 * * 0'
push:
branches:
- "**"
Expand Down Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: test
- name: Test
id: new-issue
uses: ./
with:
Expand All @@ -51,12 +51,12 @@ jobs:
- name: View Action Outputs
run: |
echo "## Auto Issue Action Summary " >> $GITHUB_STEP_SUMMARY
echo "NUMBER - ${{ steps.new-issue.outputs.NUMBER }}" >> $GITHUB_STEP_SUMMARY
echo "URL - ${{ steps.new-issue.outputs.URL }}" >> $GITHUB_STEP_SUMMARY
echo "JSON - ${{ steps.new-issue.outputs.JSON }}" >> $GITHUB_STEP_SUMMARY
echo '${{ steps.new-issue.outputs.JSON }}' | jq
echo '${{ steps.new-issue.outputs.JSON }}' | jq .state
echo '${{ steps.new-issue.outputs.JSON }}' | jq .labels[].name
echo "NUMBER - ${{ steps.new-issue.outputs.number }} " >> $GITHUB_STEP_SUMMARY
echo "URL - ${{ steps.new-issue.outputs.url }} " >> $GITHUB_STEP_SUMMARY
echo "JSON - ${{ steps.new-issue.outputs.json }} " >> $GITHUB_STEP_SUMMARY
echo '${{ steps.new-issue.outputs.json }}' | jq
echo '${{ steps.new-issue.outputs.json }}' | jq .state
echo '${{ steps.new-issue.outputs.json }}' | jq .labels[].name
push-test:
if: github.event_name == 'push'
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ COPY . .
RUN pnpm run build || exit 1

# Check if dist/index.js exists and list files in the dist directory
RUN ls -al dist || echo "dist directory not found"
RUN ls -al dist || echo "dist/ directory not found"

# Start the application with a relative path
ENTRYPOINT ["node", "./dist/index.js"]
ENTRYPOINT ["node", "dist/index.js"]

# Labels
LABEL \
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Vedansh <https://github.com/offensive-vk>
Copyright (c) 2024 - Present. Vedansh <https://github.com/offensive-vk>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ This GitHub Action allows you to automate the creation of issues in a repository
steps:
- uses: actions/checkout@v4
- name: Create an Issue
uses: offensive-vk/auto-issue@v6
uses: offensive-vk/auto-issue@v7
with:
github-token: ${{ github.token }}
title: "Automated Issue Created"
body: "This is a issue"
github-token: ${{ secrets.GITHUB_TOKEN }}
title: "Automated Issue by Actions."
body: "This is a test issue created by auto-issue action."
```
## Inputs Configuration
Expand All @@ -21,14 +21,14 @@ Configure the inputs through the `with:` section of the Action. Below is a list

| Option | Default Value | Description |
|-----------|-------------------------------|-------------|
| github-token | `${{ github.token }}` / `required` | The GitHub token used to authenticate requests. Use `${{ github.token }}` or create a PAT and store it in secrets. |
| owner | `github.context.repo.owner` | The owner of the repository where the issue will be created. Inferred from the context. |
| repo | `github.context.repo.repo` | The repository name where the issue will be created. Inferred from the context. |
| title | `required` | The title of the issue. |
| body | `null` | The body content of the issue. |
| milestone | `null` | The milestone ID to associate the issue with. |
| labels | `null` | A comma-separated list of labels to apply to the issue. |
| assignees | `${{ github.actor }}` | A comma-separated list of GitHub usernames to assign the issue to. |
| github-token | `${{ github.token }}` | The GitHub token used to authenticate requests. Use `${{ github.token }}` or create a PAT and store it in secrets. |
| owner | `github.context.repo.owner` | The owner of the repository where the issue will be created. Inferred from the context. |
| repo | `github.context.repo.repo` | The repository name where the issue will be created. Inferred from the context. |
| title | `Automated Issue` | The title of the issue. |
| body | `This Issue was automated by github-actions.` | The body content of the issue. |
| labels | `automated` | A comma-separated list of labels to apply to the issue. |
| milestone | `null` | The milestone ID to associate the issue with. |
| assignees | `github.actor` | A comma-separated list of GitHub usernames to assign the issue to. |

## Outputs

Expand Down Expand Up @@ -62,9 +62,9 @@ jobs:
uses: actions/checkout@v4
- name: Create Issue
uses: offensive-vk/auto-issue@v5
uses: offensive-vk/auto-issue@v7
with:
github-token: ${{ github.token }}
github-token: ${{ secrets.GITHUB_TOKEN }}
title: |
${{ github.workflow }} failed during ${{ github.event_name }}
assignees: ${{ github.actor }},${{ github.triggering_actor }}
Expand Down Expand Up @@ -93,12 +93,12 @@ jobs:
...
steps:
- uses: actions/checkout@v4
- uses: offensive-vk/create-issue-action@v5
- uses: offensive-vk/auto-issue@v7
id: new-issue
with:
github-token: ${{ github.token }}
github-token: ${{ secrets.GITHUB_TOKEN }}
title: Simple Issue
body: This Issue was created using the auto-issue GitHub Action.
body: This Issue was created by auto-issue GitHub Action.
- run: |
echo "${{ steps.new-issue.outputs.json }}" | jq
echo "${{ steps.new-issue.outputs.json }}" | jq .state
Expand Down
19 changes: 13 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,43 @@ inputs:
github-token:
description: "Your GitHub token (PAT or `github.token`). Required to authenticate API requests."
required: false
default: ${{ github.token }}
owner:
description: "The repository owner. If not specified, the owner will be inferred from the context."
required: false
default: ${{ github.repository_owner }}
repo:
description: "The target repository for the issue. If not specified, the current repository is used."
required: false
default: ${{ github.repository }}
title:
description: "The title of the issue. This input is required."
required: true
required: false
default: 'Automated Issue'
body:
description: "The body content of the issue. Optional."
required: false
default: 'This Issue was automated by github-actions.'
milestone:
description: "The milestone ID to associate with the issue. Optional."
required: false
labels:
description: "A comma-separated list of labels to apply to the issue (e.g., 'bug,aws'). Optional."
required: false
default: 'automated'
assignees:
description: "A comma-separated list of GitHub usernames to assign to the issue (e.g., 'Hamster,user'). Optional."
required: false

default: ${{ github.actor }}
outputs:
JSON:
json:
description: "The full JSON response for the created issue, as returned by the GitHub API."
URL:
url:
description: "The web URL of the newly created issue."
NUMBER:
number:
description: "The number of the newly created issue."

runs:
using: 'docker'
image: 'docker://ghcr.io/offensive-vk/auto-issue:latest'
image: './Dockerfile'
# image: 'docker://ghcr.io/offensive-vk/auto-issue:latest'
Loading

0 comments on commit c156e1c

Please sign in to comment.