Skip to content

Commit

Permalink
Refactoring (#239)
Browse files Browse the repository at this point in the history
* Switch to biome

* add tsconfig and set engine version

* convert utils to typescript

* remove yarn.lock

* Convert github.js to typescript (mostly?)

* Modify github.ts to import Input type from entrypoint.ts

* Translated entrypoint.js

* Fix syntax errors

* Updated entrypoint.ts

* Merge branch 'refactoring' of https://github.com/aws-actions/stale-issue-cleanup into refactoring

* Fix function signature in github.ts

* Replace redundant type definitions with imports

* Changes made to entrypoint.ts after resolving issues from PR

* remove old js files

* update dependencies

* add initial test framework

* add build system

* Added entrypoint.test.ts

* complete utils test

* update tests and minor fixes

* Added vitest coverage config

* Trying to add case where ancient issue has enough upvotes

* Added tests for core.debug() in processIssues()

* Fix bugs in reactions array and reaction counting

* Add test for ancient issue with sufficient upvotes

* Added tests for entrypoint.ts for coverage

* Fixed conflicts in entrypoint.ts

* add github workflow for dist

---------

Co-authored-by: Tom Keller <kellertk@amazon.com>
Co-authored-by: Alisha Kulkarni <alikulka@amazon.com>
Co-authored-by: Michael Lehmann <lehmanmj@amazon.com>
  • Loading branch information
3 people authored Jan 15, 2025
1 parent 413d85a commit 9f31ed5
Show file tree
Hide file tree
Showing 25 changed files with 5,321 additions and 5,238 deletions.
17 changes: 0 additions & 17 deletions .eslintrc.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/package-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Update dist files on push to main
on:
push:
branches:
- main
paths-ignore:
- 'dist/**'
workflow_dispatch:

jobs:
package:
name: Package dist files
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
persist-credentials: false
- name: Package
run: |
npm ci
npm run test
npm run package
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.SECRETS_AWS_PACKAGING_ROLE_TO_ASSUME }}
role-duration-seconds: 900
role-session-name: ${{ github.run_id }}
- name: Get git credentials
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
parse-json-secrets: true
secret-ids: |
OSDS,arn:aws:secretsmanager:us-west-2:206735643321:secret:github-aws-sdk-osds-automation-gebs9n
- name: Commit dist files to main
run: |
echo "::add-mask::${{ env.OSDS_ACCESS_TOKEN }}"
git config --global user.email "github-aws-sdk-osds-automation@amazon.com"
git config --global user.name "github-aws-sdk-osds-automation"
git remove set-url origin https://${{ env.OSDS_ACCESS_TOKEN }}@github.com/aws-actions/stale-issue-cleanup.git
git add dist
git commit -m "chore: update dist" || echo "No changes to commit"
git push --force origin
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
.env
node_modules/
coverage/
dist/*
!dist/index.js
32 changes: 0 additions & 32 deletions .mergify.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierrc.json

This file was deleted.

10 changes: 0 additions & 10 deletions Dockerfile

This file was deleted.

35 changes: 35 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"formatter": {
"indentStyle": "space",
"lineWidth": 120,
"indentWidth": 2,
"lineEnding": "lf",
"enabled": true,
},
"linter": {
"enabled": true,
"rules": {
"performance": {
"noDelete": "off",
},
"complexity": {
"noExtraBooleanCast": "off",
}
},
},
"javascript": {
"formatter": {
"trailingCommas": "all",
"jsxQuoteStyle": "double",
"quoteStyle": "single",
"bracketSpacing": true,
"arrowParentheses": "always",
},
},
"json": {
"formatter": {
"trailingCommas": "all",
},
},
}

9 changes: 9 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 9f31ed5

Please sign in to comment.