From 3213986abbe286dfe4a8b2c2d0232ec1b827fa9e Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 3 Oct 2024 14:25:04 -0400 Subject: [PATCH 1/2] Restrict release auto publish only on main branch and update test (#18) * Restrict release auto publish only on main branch Signed-off-by: Peter Zhu * Restrict release auto publish only on main branch Signed-off-by: Peter Zhu * Bump version Signed-off-by: Peter Zhu * Separate test and junit to two commands Signed-off-by: Peter Zhu --------- Signed-off-by: Peter Zhu --- .github/workflows/build-test.yml | 4 +++- .github/workflows/releases.yml | 3 +++ package.json | 5 +++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 0e6d56d..a2e2030 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -25,8 +25,10 @@ jobs: - name: Verify styling failure msg if: steps.style_verify.outcome == 'failure' run: echo "Please run 'npm run format' before commiting the code!" - - name: Run build + - name: Run build test run: npm run build + - name: Run junit + run: npm run junit - name: Upload results to Codecov uses: codecov/codecov-action@v4 with: diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 7e9a8a7..0e0f6ba 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -2,12 +2,15 @@ name: Release Automation App on: push: + branches: + - main permissions: contents: write jobs: release-automation-app: + if: github.repository == 'opensearch-project/automation-app' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/package.json b/package.json index 70118d6..b3a280b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensearch-automation-app", - "version": "0.1.4", + "version": "0.1.5", "description": "An Automation App that handles all your GitHub Repository Activities", "author": "Peter Zhu", "homepage": "https://github.com/opensearch-project/automation-app", @@ -22,7 +22,8 @@ "format": "prettier --write src/**/*.ts test/**/*.ts configs/**/*.yml", "format-dryrun": "prettier --check src/**/*.ts test/**/*.ts configs/**/*.yml", "lint": "eslint --fix \"src/**/*.ts\" --ignore-pattern \"**/*.d.ts\"", - "test": "jest --coverage --reporters=jest-junit" + "test": "jest --coverage", + "junit": "jest --reporters=jest-junit" }, "dependencies": { "@aws-sdk/client-opensearch": "^3.658.1", From 8b9662bd9da6a2e377bf1796d0a7d30b22078fe0 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 3 Oct 2024 14:44:52 -0400 Subject: [PATCH 2/2] Update Readme links and add env example (#20) * Update Readme links and add env example Signed-off-by: Peter Zhu * ignore env example Signed-off-by: Peter Zhu * Update workflow naming Signed-off-by: Peter Zhu * update link Signed-off-by: Peter Zhu --------- Signed-off-by: Peter Zhu --- .env.example | 5 +++++ .github/workflows/check-version-bump.yml | 2 +- .github/workflows/license-header-checker.yml | 2 +- .gitignore | 2 +- .licenserc.json | 3 ++- README.md | 6 +++--- package.json | 2 +- 7 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..f09c41f --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +WEBHOOK_PROXY_URL= +APP_ID= +PRIVATE_KEY= +WEBHOOK_SECRET= +INSTALLATION_ID= diff --git a/.github/workflows/check-version-bump.yml b/.github/workflows/check-version-bump.yml index 6445831..9b10ab5 100644 --- a/.github/workflows/check-version-bump.yml +++ b/.github/workflows/check-version-bump.yml @@ -1,5 +1,5 @@ --- -name: Check Version Bump +name: check-version-bump on: pull_request: diff --git a/.github/workflows/license-header-checker.yml b/.github/workflows/license-header-checker.yml index d026f0b..7b68143 100644 --- a/.github/workflows/license-header-checker.yml +++ b/.github/workflows/license-header-checker.yml @@ -1,5 +1,5 @@ --- -name: License Header Checker +name: license-header-checker on: [push, pull_request] diff --git a/.gitignore b/.gitignore index 2e99f1c..4aadc85 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ npm-debug.log *.pem *.swp* !mock-cert.pem -.env* +.env coverage junit.xml bin diff --git a/.licenserc.json b/.licenserc.json index 85e7ef2..884b9fb 100644 --- a/.licenserc.json +++ b/.licenserc.json @@ -28,6 +28,7 @@ ".gz", ".toml", ".ini", - "gradle/wrapper" + "gradle/wrapper", + ".env.example" ] } diff --git a/README.md b/README.md index 8e2d8f8..ef16f11 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This repository hosts the source code of an automation app to handle the daily a ## Project Resources -The automation app utilizes the [Probot](https://probot.github.io/) framework and [Octokit](https://docs.github.com/en/rest/using-the-rest-api/libraries-for-the-rest-api?apiVersion=2022-11-28) library to perform user-defined operations on top of the resources within GitHub. See [configs](configs/operations/hello-world.yml) yaml for more information. +The automation app utilizes the [Probot](https://probot.github.io/) framework and [Octokit](https://docs.github.com/en/rest/using-the-rest-api/libraries-for-the-rest-api?apiVersion=2022-11-28) library to perform user-defined operations on top of the resources within GitHub. See [configs](configs) yaml for more information. ## Usages @@ -33,8 +33,8 @@ A `Service` is an instance of the app that manages and manipulates specific `Res To create a service, you need two configuration files: -- **Resource configuration file**: Defines the resources that the service will manage or modify (`configs/resources/sample-resource.yml`). -- **Operation configuration file**: Defines the operations (tasks) that the service will execute with the resources (`configs/resources/sample-operation.yml`). +- **Resource configuration file**: Defines the resources that the service will manage or modify. [Sample Resource Config](configs/resources/sample-resource.yml). +- **Operation configuration file**: Defines the operations (tasks) that the service will execute with the resources. [Sample Operation Config](configs/operations/sample-operation.yml). ### Start the Service diff --git a/package.json b/package.json index b3a280b..494cca2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensearch-automation-app", - "version": "0.1.5", + "version": "0.1.6", "description": "An Automation App that handles all your GitHub Repository Activities", "author": "Peter Zhu", "homepage": "https://github.com/opensearch-project/automation-app",