Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Panayil <[email protected]>
  • Loading branch information
sachin-panayil committed Dec 20, 2024
1 parent ab87c5e commit 5b7ee3e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/send-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
uses: sachin-panayil/repolinter-action@main
with:
output_type: 'pull-request'
pull_request_labels: 'repolinter, OSPO, Tier 1'
labels: 'repolinter, OSPO, Tier 1'


4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ inputs:
This option will be ignored if output_type != "issue".
default: 'fbca04'
pull_request_labels:
labels:
required: false
description: >
The labels that you want to use to add to your properly.
Expand All @@ -135,7 +135,7 @@ runs:
INPUT_OUTPUT_NAME: ${{ inputs.output_name }}
INPUT_ISSUE_LABEL_NAME: ${{ inputs.issue_label_name }}
INPUT_ISSUE_LABEL_COLOR: ${{ inputs.issue_label_color }}
INPUT_PULL_REQUEST_LABELS: ${{ inputs.pull_request_labels }}
INPUT_LABELS: ${{ inputs.labels }}
branding:
color: green
icon: refresh-cw
9 changes: 5 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ function getInputs() {
LABEL_NAME: core.getInput("label_name" /* LABEL_NAME */, { required: true }),
LABEL_COLOR: core.getInput("label_color" /* LABEL_COLOR */, { required: true }),
BASE_BRANCH: core.getInput("base_branch" /* BASE_BRANCH */, { required: true }),
PULL_REQUEST_LABELS: core.getInput("pull_request_labels" /* PULL_REQUEST_LABELS */, { required: true })
LABELS: core.getInput("labels" /* LABELS */, { required: true })
};
}
function getRunNumber() {
Expand Down Expand Up @@ -623,7 +623,7 @@ function run(disableRetry) {
// load the configuration from file or url, depending on which one is configured
try {
// get all inputs
const { DIRECTORY, TOKEN, USERNAME, CONFIG_FILE, CONFIG_URL, REPO, OUTPUT_TYPE, OUTPUT_NAME, LABEL_NAME, LABEL_COLOR, BASE_BRANCH, PULL_REQUEST_LABELS } = getInputs();
const { DIRECTORY, TOKEN, USERNAME, CONFIG_FILE, CONFIG_URL, REPO, OUTPUT_TYPE, OUTPUT_NAME, LABEL_NAME, LABEL_COLOR, BASE_BRANCH, LABELS } = getInputs();
const RUN_NUMBER = getRunNumber();
// verify the directory exists and is a directory
try {
Expand Down Expand Up @@ -714,7 +714,8 @@ function run(disableRetry) {
core.startGroup('Sending a PR');
try {
const [owner, repo] = REPO.split('/');
const cleanedLabels = PULL_REQUEST_LABELS.split(",");
const originalLables = LABELS.replace(/\s/g, "");
const cleanedLabels = originalLables.split(",");
const jsonOutput = repolinter_1.jsonFormatter.formatOutput(result, true);
const files = getFileChanges_1.getFileChanges(jsonOutput);
if (Object.keys(files).length !== 0) {
Expand All @@ -732,8 +733,8 @@ function run(disableRetry) {
}]
});
if (pr) {
core.info(`Lables: ${cleanedLabels} `);
core.info(`Created PR: ${pr.data.html_url}`);
core.info(`Labels: ${LABELS}`);
}
}
else {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const enum ActionInputs {
LABEL_NAME = 'label_name',
LABEL_COLOR = 'label_color',
BASE_BRANCH = "base_branch",
PULL_REQUEST_LABELS = 'pull_request_labels'
LABELS = 'labels'
}

export const enum ActionOutputs {
Expand Down
11 changes: 6 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function getInputs(): {[key: string]: string} {
LABEL_NAME: core.getInput(ActionInputs.LABEL_NAME, {required: true}),
LABEL_COLOR: core.getInput(ActionInputs.LABEL_COLOR, {required: true}),
BASE_BRANCH: core.getInput(ActionInputs.BASE_BRANCH, {required: true}),
PULL_REQUEST_LABELS: core.getInput(ActionInputs.PULL_REQUEST_LABELS, {required: true})
LABELS: core.getInput(ActionInputs.LABELS, {required: true})
}
}

Expand Down Expand Up @@ -78,7 +78,7 @@ export default async function run(disableRetry?: boolean): Promise<void> {
LABEL_NAME,
LABEL_COLOR,
BASE_BRANCH,
PULL_REQUEST_LABELS
LABELS
} = getInputs()
const RUN_NUMBER = getRunNumber()
// verify the directory exists and is a directory
Expand Down Expand Up @@ -169,7 +169,8 @@ export default async function run(disableRetry?: boolean): Promise<void> {

try {
const [owner, repo] = REPO.split('/')
const cleanedLabels = PULL_REQUEST_LABELS.split(",")
const originalLables = LABELS.replace(/\s/g, "");
const cleanedLabels = originalLables.split(",")

const jsonOutput = jsonFormatter.formatOutput(result, true)
const files = getFileChanges(jsonOutput)
Expand All @@ -190,9 +191,9 @@ export default async function run(disableRetry?: boolean): Promise<void> {
})

if (pr) {
core.info(`Lables: ${cleanedLabels} `)
core.info(`Created PR: ${pr.data.html_url}`)
}
core.info(`Labels: ${LABELS}`)
}

} else {
console.log("No changes detected")
Expand Down

0 comments on commit 5b7ee3e

Please sign in to comment.