{"id":19505571,"url":"https://github.com/bogdaaamn/copy-sentiment-analysis","last_synced_at":"2025-02-25T22:15:14.278Z","repository":{"id":44151367,"uuid":"287559475","full_name":"bogdaaamn/copy-sentiment-analysis","owner":"bogdaaamn","description":"Run sentiment analysis over the text of your website using Google API. ","archived":false,"fork":false,"pushed_at":"2022-01-17T15:29:38.000Z","size":3669,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-19T04:36:55.708Z","etag":null,"topics":["actions","google-api","javascript-action","sentiment-analysis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bogdaaamn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-14T15:02:43.000Z","updated_at":"2022-07-08T17:43:09.000Z","dependencies_parsed_at":"2023-01-05T04:48:09.411Z","dependency_job_id":null,"html_url":"https://github.com/bogdaaamn/copy-sentiment-analysis","commit_stats":{"total_commits":43,"total_committers":2,"mean_commits":21.5,"dds":"0.16279069767441856","last_synced_commit":"c40d889bb14305dbf23e576639a641b0d70f31f3"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":"actions/javascript-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdaaamn%2Fcopy-sentiment-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdaaamn%2Fcopy-sentiment-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdaaamn%2Fcopy-sentiment-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdaaamn%2Fcopy-sentiment-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bogdaaamn","download_url":"https://codeload.github.com/bogdaaamn/copy-sentiment-analysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240754367,"owners_count":19852189,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","google-api","javascript-action","sentiment-analysis"],"created_at":"2024-11-10T22:31:48.571Z","updated_at":"2025-02-25T22:15:14.191Z","avatar_url":"https://github.com/bogdaaamn.png","language":"JavaScript","readme":"# Copy Sentiment Analysis\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/BogDAAAMN/copy-sentiment-analysis/actions\"\u003e\u003cimg alt=\"javscript-action status\" src=\"https://github.com/BogDAAAMN/copy-sentiment-analysis/workflows/sentiment-analysis/badge.svg\"\u003e\u003c/a\u003e \u003ca href=\"https://snyk.io/test/github/BogDAAAMN/copy-sentiment-analysis?targetFile=package.json\"\u003e\u003cimg src=\"https://snyk.io/test/github/BogDAAAMN/copy-sentiment-analysis/badge.svg?targetFile=package.json\" alt=\"Known Vulnerabilities\" data-canonical-src=\"https://snyk.io/test/github/BogDAAAMN/copy-sentiment-analysis?targetFile=package.json\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nThis GitHub Action runs Sentiment Analysis over the **built** text of your GitHub project. It uses Google's [analyzeSentiment API](https://cloud.google.com/natural-language/docs/analyzing-sentiment#language-sentiment-string-protocol), evaluating the overall emotion score (from positive to negative) of a page. The Action provides an overview of the scores of all the pages from your project (more on [interpreting the scores](https://cloud.google.com/natural-language/docs/basics#interpreting_sentiment_analysis_values)).\n\n## 🚀 Usage \n\n![Usage example](https://github.com/BogDAAAMN/copy-sentiment-analysis/blob/v0.6.1/_static/gif/usage.gif)\n\nThis is a workflow example of using the Action on plain `.html` files from the `public` folder (by default).\n\n```yaml\nname: Sentiment analysis on public\n\non: push\n\njobs:\n  analysis:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2 #Be sure you checkout the files beforehand\n    - name: Run sentiment analysis on HTML files\n      uses: bogdaaamn/copy-sentiment-analysis@v0.6.1\n      with: \n        gcp_key: ${{ secrets.GCP_KEY }} #Google Cloud Platform API key. Read the README for instructions \n```\n\nAlthough, if you project needs to be built beforehand, be sure you place the Action after the building step. Here is an example for React.\n\n```yaml\nname: Sentiment analysis on React\n\non: push\n\njobs:\n  analysis:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2 #Be sure you checkout the files beforehand\n    - name: Build and test #Build the HTML files beforehand.\n      run: |\n        npm ci\n        npm run build\n        npm test\n    - name: Run sentiment analysis on HTML files\n      uses: bogdaaamn/copy-sentiment-analysis@v0.6.1\n      with: \n        gcp_key: ${{ secrets.GCP_KEY }} #Google Cloud Platform API key. Read the README for instructions\n        files: \"build/**/*.html\" #Glob patterns from files to be analayzed. Read the README for instructions\n```\n\n## 🏹 Inputs\n\n### `gcp_key`: Get your GCP API Key\n\nThe examples above use **required** input `gcp_key`. Because the Actions uses the Google API you need generate a key on your own as it follows:\n\n- Log into [Google Cloud Platform Console](https://console.cloud.google.com/);\n- Navigate to the menu and click on **[API\u0026Services](https://console.cloud.google.com/apis/dashboard)** \u003e **[Credentials](https://console.cloud.google.com/apis/credentials)**;\n- Click on **CREATE CREDENTIALS** \u003e **API Key**;\n- When *API key created* modal is promted, copy the freshly created key.\n\nRead more about [Creating API Keys](https://cloud.google.com/docs/authentication/api-keys#creating_an_api_key).\n\n![GCP Visual Instructions](https://github.com/BogDAAAMN/copy-sentiment-analysis/blob/v0.6.1/_static/gif/gcp.gif)\n\n⚠️ Be **very** sure you don't share the key or paste it in plain code! It is enough to add it to the GitHub Project's Secrets as it follows:\n\n- On your project's page click on the **Settings** button;\n- Navigate to **Secrets** panel;\n- Click on **New secret**;\n- Name it *GCP_KEY* and paste the key there.\n\n🚀 Now you can use the key in your project's Actions as `${{ secrets.GCP_KEY }}`. Read more about [GitHub Secrets](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets).\n\n![GitHub Visual Instructions](https://github.com/BogDAAAMN/copy-sentiment-analysis/blob/v0.6.1/_static/gif/github.gif)\n\n### `files`: Understanding glob\n\nThe `files` input is the glob pattern of paths for the files that the Action should analyze. **By default** it is set to `public/**/*.html`, meaning that will check for all the files with `.html` extension in all the directories in the `public` directory. \n\nRead more, and understand glob patterns and their limitations on [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob#patterns).\n\n## 🔧 Known issues and limitations\n\nThis an early release of the Action. The roadmap of known issues and features will be updated here.\n\n- **Parse and merge more content tags**: ⚠️ For now, this Action takes into account only `\u003cp\u003e` HTML tags. As more use cases will be tested, more tags will be included, along with the possibility of customization.  \n- **Custom score threshold**: The overview table printed as a result of the Action highlights with color the very negative and very positive documents. At the moment, the threshold of the emotion score is predefined at `±0.5`. The next release will allow the user to define the threshold so they can get a custom color-coded table.\n- **Split the base directory of the path**: At this moment, the overview table prints only the name of the file, creating confusion between files with the same name in different directories. In the next release, the table will print the relative path of the file.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogdaaamn%2Fcopy-sentiment-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbogdaaamn%2Fcopy-sentiment-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogdaaamn%2Fcopy-sentiment-analysis/lists"}