All Projects → peter-evans → commit-comment

peter-evans / commit-comment

Licence: MIT License
A GitHub action to create a comment for a commit on GitHub

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to commit-comment

action-sync-node-meta
GitHub Action that syncs package.json with the repository metadata.
Stars: ✭ 25 (-59.68%)
Mutual labels:  github-api, github-actions
vidyabhandary
Self updating profile readme for github
Stars: ✭ 36 (-41.94%)
Mutual labels:  github-api, github-actions
actions
Collection of repetitive GitHub Actions
Stars: ✭ 12 (-80.65%)
Mutual labels:  github-api, github-actions
dart-package-analyzer
GitHub Action that uses the Dart Package Analyzer to compute the Pub score of Dart/Flutter packages
Stars: ✭ 44 (-29.03%)
Mutual labels:  github-actions
helm-gh-pages
A GitHub Action for publishing Helm charts to Github Pages
Stars: ✭ 60 (-3.23%)
Mutual labels:  github-actions
cuda-toolkit
GitHub Action to install CUDA
Stars: ✭ 34 (-45.16%)
Mutual labels:  github-actions
release-notify-action
GitHub Action that triggers e-mails with release notes when these are created
Stars: ✭ 64 (+3.23%)
Mutual labels:  github-actions
composer-install
A GitHub Action to streamline installation of PHP dependencies with Composer.
Stars: ✭ 151 (+143.55%)
Mutual labels:  github-actions
autoupdate
A GitHub Action that auto-updates pull requests branches, whenever changes are pushed to their destination branch.
Stars: ✭ 70 (+12.9%)
Mutual labels:  github-actions
Explorer-for-GitHub
📱An iOS app that lets you explore repositories on GitHub
Stars: ✭ 14 (-77.42%)
Mutual labels:  github-api
perseverance
Make your functions 💪 resilient and 🚥 fail-fast to 💩 failures or ⌚ delays
Stars: ✭ 12 (-80.65%)
Mutual labels:  github-actions
drupal9ci
One-line installers for implementing Continuous Integration in Drupal 9
Stars: ✭ 137 (+120.97%)
Mutual labels:  github-actions
meet-the-fans
Query and Visualize the network graph of your GitHub repositories, followers, stargazers, and forks.
Stars: ✭ 22 (-64.52%)
Mutual labels:  github-api
bake-action
GitHub Action to use Docker Buildx Bake as a high-level build command
Stars: ✭ 52 (-16.13%)
Mutual labels:  github-actions
ghaction-upx
GitHub Action for UPX, the Ultimate Packer for eXecutables
Stars: ✭ 27 (-56.45%)
Mutual labels:  github-actions
GitHubSearch
GitHub iOS client with minimum third-party dependencies.
Stars: ✭ 34 (-45.16%)
Mutual labels:  github-api
ghaction-import-gpg
GitHub Action to easily import a GPG key
Stars: ✭ 161 (+159.68%)
Mutual labels:  github-actions
megalinter
🦙 Mega-Linter analyzes 48 languages, 22 formats, 19 tooling formats, excessive copy-pastes, spelling mistakes and security issues in your repository sources with a GitHub Action, other CI tools or locally.
Stars: ✭ 534 (+761.29%)
Mutual labels:  github-actions
action-autotag
Automatically generate a new tag when the manifest file (package.json, Dockerfile, custom file, etc) version changes.
Stars: ✭ 45 (-27.42%)
Mutual labels:  github-actions
autoSubmit
北京大学疫情出入校自动填报
Stars: ✭ 47 (-24.19%)
Mutual labels:  github-actions

Commit Comment

CI GitHub Marketplace

A GitHub action to create a comment for a commit on GitHub.

Commit Comment Example

Usage

      - name: Create commit comment
        uses: peter-evans/commit-comment@v1
        with:
          body: |
            This is a multi-line test comment
            - With GitHub **Markdown** :sparkles:
            - Created by [commit-comment][1]

            [1]: https://github.com/peter-evans/commit-comment

Action inputs

Name Description Default
token GITHUB_TOKEN or a repo scoped PAT. GITHUB_TOKEN
repository The full name of the target repository. github.repository (current repository)
sha The commit SHA. github.sha OR, for pull_request events github.event.pull_request.head.sha
body (required) The contents of the comment.
path Relative path of the file to comment on.
position Line index in the diff to comment on.

Example

Here is an example setting optional input parameters.

      - name: Create commit comment
        uses: peter-evans/commit-comment@v1
        with:
          sha: 843dea1cc2e721163c20a5c876b5b155f7f3aa75
          body: |
            This is a multi-line test comment
            - With GitHub **Markdown** :sparkles:
            - Created by [commit-comment][1]

            [1]: https://github.com/peter-evans/commit-comment
          path: path/to/file.txt
          position: 1

Setting the comment body from a file

This example shows how file content can be read into a variable and passed to the action. The content must be escaped to preserve newlines.

      - id: get-comment-body
        run: |
          body=$(cat comment-body.txt)
          body="${body//'%'/'%25'}"
          body="${body//$'\n'/'%0A'}"
          body="${body//$'\r'/'%0D'}" 
          echo ::set-output name=body::$body

      - name: Create commit comment
        uses: peter-evans/commit-comment@v1
        with:
          body: ${{ steps.get-comment-body.outputs.body }}

Accessing commits in other repositories

You can create a commit comment in another repository by using a PAT instead of GITHUB_TOKEN. The user associated with the PAT must have write access to the repository.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].