{"id":15767823,"url":"https://github.com/technote-space/download-annotations-action","last_synced_at":"2025-04-21T04:31:13.864Z","repository":{"id":37001338,"uuid":"319864337","full_name":"technote-space/download-annotations-action","owner":"technote-space","description":"GitHub actions to download annotations","archived":false,"fork":false,"pushed_at":"2023-12-24T17:31:33.000Z","size":5995,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T21:53:18.384Z","etag":null,"topics":["annotations","github-actions"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/technote-space.png","metadata":{"files":{"readme":"README.ja.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"https://paypal.me/technote0space"}},"created_at":"2020-12-09T06:31:31.000Z","updated_at":"2024-10-03T05:09:51.000Z","dependencies_parsed_at":"2024-10-25T13:48:21.086Z","dependency_job_id":"2976036f-8ddc-4f06-956f-4937148efd66","html_url":"https://github.com/technote-space/download-annotations-action","commit_stats":{"total_commits":208,"total_committers":2,"mean_commits":104.0,"dds":0.4326923076923077,"last_synced_commit":"5dd7625efb21b1050820e6111374b49205bcd54c"},"previous_names":[],"tags_count":152,"template":false,"template_full_name":"technote-space/gh-actions-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fdownload-annotations-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fdownload-annotations-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fdownload-annotations-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/technote-space%2Fdownload-annotations-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/technote-space","download_url":"https://codeload.github.com/technote-space/download-annotations-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249996085,"owners_count":21358058,"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":["annotations","github-actions"],"created_at":"2024-10-04T13:41:20.618Z","updated_at":"2025-04-21T04:31:13.574Z","avatar_url":"https://github.com/technote-space.png","language":"TypeScript","funding_links":["https://paypal.me/technote0space"],"categories":[],"sub_categories":[],"readme":"# Download Annotations Action\n\n[![CI Status](https://github.com/technote-space/download-annotations-action/workflows/CI/badge.svg)](https://github.com/technote-space/download-annotations-action/actions)\n[![codecov](https://codecov.io/gh/technote-space/download-annotations-action/branch/main/graph/badge.svg)](https://codecov.io/gh/technote-space/download-annotations-action)\n[![CodeFactor](https://www.codefactor.io/repository/github/technote-space/download-annotations-action/badge)](https://www.codefactor.io/repository/github/technote-space/download-annotations-action)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/technote-space/download-annotations-action/blob/main/LICENSE)\n\n*Read this in other languages: [English](README.md), [日本語](README.ja.md).*\n\nGitHub actions to download annotations.\n\n## Table of Contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\u003cdetails\u003e\n\u003csummary\u003eDetails\u003c/summary\u003e\n\n- [使用方法](#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)\n- [Options](#options)\n- [Outputs](#outputs)\n  - [number](#number)\n  - [messages](#messages)\n  - [path](#path)\n  - [result_path](#result_path)\n- [Author](#author)\n\n\u003c/details\u003e\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## 使用方法\n例：`.github/workflows/check-warnings.yml`  \n```yaml\non:\n  workflow_run:\n    workflows:\n      - Workflow name1\n      - Workflow name2\n      # ...\n    types:\n      - completed\n\nname: Check Warnings\n\njobs:\n  annotations:\n    name: Annotations\n    runs-on: ubuntu-latest\n    timeout-minutes: 3\n    steps:\n      - uses: technote-space/download-annotations-action@v1\n        id: annotations\n        with:\n          TARGET_RUN_ID: ${{ github.event.workflow_run.id }}\n          INCLUDE_LEVELS: warning\n          # EXCLUDE_MESSAGE_PATTERNS: |\n          #  *warning jest*\n      - name: Build attachments\n        run: |\n          arr1='[{\"fields\":[{\"title\":\"repo\",\"value\":\"\u003chttps://github.com/${{ github.repository }}|${{ github.repository }}\u003e\",\"short\":true},{\"title\":\"action\",\"value\":\"\u003c${{ github.event.workflow_run.html_url }}|action\u003e\",\"short\":true}]}]'\n          arr2=$(echo '${{ steps.annotations.outputs.messages }}' | jq -c 'map({\"color\":\"warning\",\"text\":\"```\\(.)```\"})')\n          echo \"SLACK_ATTACHMENTS=$(jq --argjson arr1 \"$arr1\" --argjson arr2 \"$arr2\" -nc '$arr1 + $arr2')\" \u003e\u003e $GITHUB_ENV\n        if: steps.annotations.outputs.number \u003e 0\n      - uses: 8398a7/action-slack@v3\n        with:\n          status: custom\n          fields: repo\n          custom_payload: |\n            {\n              text: \"Warning annotations\",\n              attachments: ${{ env.SLACK_ATTACHMENTS }}\n            }\n        env:\n          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}\n        if: steps.annotations.outputs.number \u003e 0 \u0026\u0026 env.SLACK_WEBHOOK_URL\n```\n\n\n![result](https://raw.githubusercontent.com/technote-space/download-annotations-action/images/slack.png)\n\n## Options\n詳細は [actions.yml](./action.yml)\n\n## Outputs\n### number\nannotation の数\n\n例：\n```shell script\necho ${{ steps.annotations.outputs.messages }}\n```\n\n```shell script\n1\n```\n\n### messages\nすべての annotation のメッセージ\n\n例：\n```shell script\necho '${{ steps.annotations.outputs.number }}' | jq\n```\n\n```shell script\n[\n  \"Warning test message\",\n  \"Failure test message\",\n  \"Notice test message\"\n]\n```\n\n### path\nannotation のファイルパス\n\n例：\n```json\n[\n    {\n        \"path\": \"README.md\",\n        \"start_line\": 2,\n        \"end_line\": 2,\n        \"start_column\": 5,\n        \"end_column\": 10,\n        \"annotation_level\": \"warning\",\n        \"title\": \"Warning test\",\n        \"message\": \"Warning test message\",\n        \"raw_details\": \"Warning test details\",\n        \"blob_href\": \"https://api.github.com/repos/github/rest-api-description/git/blobs/abc\"\n    },\n    {\n        \"path\": \"README.md\",\n        \"start_line\": 2,\n        \"end_line\": 2,\n        \"start_column\": 5,\n        \"end_column\": 10,\n        \"annotation_level\": \"failure\",\n        \"title\": \"Failure test\",\n        \"message\": \"Failure test message\",\n        \"raw_details\": \"Failure test details\",\n        \"blob_href\": \"https://api.github.com/repos/github/rest-api-description/git/blobs/abc\"\n    },\n    {\n        \"path\": \"README.md\",\n        \"start_line\": 2,\n        \"end_line\": 2,\n        \"start_column\": 5,\n        \"end_column\": 10,\n        \"annotation_level\": \"notice\",\n        \"title\": \"Notice test\",\n        \"message\": \"Notice test message\",\n        \"raw_details\": \"Notice test details\",\n        \"blob_href\": \"https://api.github.com/repos/github/rest-api-description/git/blobs/abc\"\n    }\n]\n```\n\n### result_path\n結果のファイルパス\n\n例：\n```json\n[\n    {\n        \"job\": {\n          \"id\": 1511906976,\n          \"run_id\": 406257557,\n          \"status\": \"completed\",\n          \"conclusion\": \"success\",\n          \"name\": \"ESLint\"\n        },\n        \"annotations\": [\n            {\n                \"path\": \"README.md\",\n                \"start_line\": 2,\n                \"end_line\": 2,\n                \"start_column\": 5,\n                \"end_column\": 10,\n                \"annotation_level\": \"warning\",\n                \"title\": \"Warning test\",\n                \"message\": \"Warning test message\",\n                \"raw_details\": \"Warning test details\",\n                \"blob_href\": \"https://api.github.com/repos/github/rest-api-description/git/blobs/abc\"\n            },\n            {\n                \"path\": \"README.md\",\n                \"start_line\": 2,\n                \"end_line\": 2,\n                \"start_column\": 5,\n                \"end_column\": 10,\n                \"annotation_level\": \"failure\",\n                \"title\": \"Failure test\",\n                \"message\": \"Failure test message\",\n                \"raw_details\": \"Failure test details\",\n                \"blob_href\": \"https://api.github.com/repos/github/rest-api-description/git/blobs/abc\"\n            }\n        ]\n    },\n    {\n        \"job\": {\n            \"id\": 1511909554,\n            \"run_id\": 406257557,\n            \"status\": \"completed\",\n            \"conclusion\": \"success\",\n            \"name\": \"Jest\"\n        },\n        \"annotations\": [\n            {\n                \"path\": \"README.md\",\n                \"start_line\": 2,\n                \"end_line\": 2,\n                \"start_column\": 5,\n                \"end_column\": 10,\n                \"annotation_level\": \"notice\",\n                \"title\": \"Notice test\",\n                \"message\": \"Notice test message\",\n                \"raw_details\": \"Notice test details\",\n                \"blob_href\": \"https://api.github.com/repos/github/rest-api-description/git/blobs/abc\"\n            }\n        ]\n    }\n]\n```\n\n## Author\n[GitHub (Technote)](https://github.com/technote-space)  \n[Blog](https://technote.space)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnote-space%2Fdownload-annotations-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechnote-space%2Fdownload-annotations-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechnote-space%2Fdownload-annotations-action/lists"}