Skip to content

Commit

Permalink
Merge pull request #14 from aws-actions/refactor
Browse files Browse the repository at this point in the history
feat!: refactor to latest core library
  • Loading branch information
alikulka authored Jan 30, 2025
2 parents 3754869 + 2210317 commit 10aaf63
Show file tree
Hide file tree
Showing 570 changed files with 444,417 additions and 1,266 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
9 changes: 0 additions & 9 deletions .eslintrc.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
.eslintcache
.node_repl_history
.env
node_modules/
coverage/
6 changes: 0 additions & 6 deletions Dockerfile

This file was deleted.

8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# action.yml
---
name: 'Closed Issue Message'
description: 'Add a default comment on all issues that get closed'
inputs:
Expand All @@ -9,8 +9,8 @@ inputs:
description: 'The message you want to be commented whenever an issue is closed'
required: true
runs:
using: 'docker'
image: 'Dockerfile'
using: 'node20'
main: 'entrypoint.js'
branding:
icon: 'message-square'
color: 'orange'
color: 'orange'
26 changes: 26 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"formatter": {
"indentStyle": "space",
"lineWidth": 120,
"indentWidth": 2,
"lineEnding": "lf",
"enabled": true,
},
"linter": {
"enabled": true,
},
"javascript": {
"formatter": {
"trailingCommas": "all",
"jsxQuoteStyle": "double",
"quoteStyle": "single",
"bracketSpacing": true,
"arrowParentheses": "always",
},
},
"json": {
"formatter": {
"trailingCommas": "all",
},
},
}
27 changes: 27 additions & 0 deletions entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as core from '@actions/core';
import * as github from '@actions/github';
import { exit } from 'node:process';

const token = core.getInput('repo-token', { required: true });
const octokit = github.getOctokit(token);
const message = core.getInput('message', { required: true });

const issueNumber = github.context.payload.issue?.number || github.context.payload.pull_request?.number;
if (!issueNumber) {
core.setFailed('No issue or pull request found in the context');
exit(core.ExitCode.Failure);
}

try {
await octokit.rest.issues.createComment({
...github.context.repo,
issue_number: issueNumber,
body: message
});
core.info(`Commented on issue #${issueNumber}`);
} catch (error) {
core.setFailed(error.message);
exit(core.ExitCode.Failure);
}

exit(core.ExitCode.Success);
16 changes: 16 additions & 0 deletions node_modules/.bin/biome

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/biome.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions node_modules/.bin/biome.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 10aaf63

Please sign in to comment.