Skip to content

Commit

Permalink
Merge pull request #3 from ArnavK-09/ff
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
ArnavK-09 authored Feb 5, 2024
2 parents ec7614b + 2c67e2f commit 68f8812
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/convert-pull-request-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Convert Pull Req Title Into Conventional Commit Scheme
on:
pull_request:
types:
- opened
- opened

jobs:
convert:
runs-on: ubuntu-latest
steps:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

Expand Down
15 changes: 3 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ description: By utilizing this action, users can automatically convert new pull
author: ArnavK-09

branding:
icon: 'message-square'
color: 'gray-dark'
icon: "message-square"
color: "gray-dark"

inputs:
gemini_api_key:
description: "Your Google Gemini API Key..."
Expand All @@ -14,15 +14,6 @@ inputs:
description: "If to add emoji in starting of commit message..."
required: false
default: true
owner:
description: "The owner of the repository..."
required: true
repo:
description: "The name of the repository..."
required: true
pr_number:
description: "The number of the pull request..."
required: true
token:
description: "The token to use to access the GitHub API..."
required: true
Expand Down
16 changes: 12 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31763,14 +31763,22 @@ const initAction = async () => {
* Fetching inputs for actions
**/
const GEMINI_API_KEY = core.getInput("gemini_api_key", { required: true });
const owner = core.getInput("owner", { required: true });
const repo = core.getInput("repo", { required: true });
const pull_number = core.getInput("pr_number", { required: true });
const token = core.getInput("token", { required: true });
const owner = github.context.repository.split("/")[0];
const repo = github.context.repository.split("/")[1];
const pull_number = github.context.payload.pull_request.number;
const includeEmoji = core.getBooleanInput("include_emoji", {
required: false,
});

/**
* Logging details
*/
core.debug(`Github Payload: ${github.context.payload}`);
core.notice(
`Repo Owner: ${owner}\nRepo Name: ${repo}\nPull Request Number: ${pull_number}\nEmojis Included: ${includeEmoji}`,
);

/**
* Inform user about emoji
*/
Expand Down Expand Up @@ -31843,7 +31851,7 @@ const initAction = async () => {
/**
* If any error, inform workflow
*/
core.setFailed(error.message);
core.setFailed(error);
}
};

Expand Down
14 changes: 11 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,22 @@ const initAction = async () => {
* Fetching inputs for actions
**/
const GEMINI_API_KEY = core.getInput("gemini_api_key", { required: true });
const owner = core.getInput("owner", { required: true });
const repo = core.getInput("repo", { required: true });
const pull_number = core.getInput("pr_number", { required: true });
const token = core.getInput("token", { required: true });
const owner = github.context.repository.split("/")[0];
const repo = github.context.repository.split("/")[1];
const pull_number = github.context.payload.pull_request.number;
const includeEmoji = core.getBooleanInput("include_emoji", {
required: false,
});

/**
* Logging details
*/
core.debug(`Github Payload: ${github.context.payload}`);
core.notice(
`Repo Owner: ${owner}\nRepo Name: ${repo}\nPull Request Number: ${pull_number}\nEmojis Included: ${includeEmoji}`,
);

/**
* Inform user about emoji
*/
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "convert_pull_req_title_into_conventional_commit_scheme",
"version": "0.0.1",
"version": "0.0.3",
"description": "By utilizing this action, users can automatically convert new pull request titles into the conventional commits format",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "npx ncc build index.js"
},
"keywords": [
"github-action",
Expand Down

0 comments on commit 68f8812

Please sign in to comment.