GithubHelp home page GithubHelp logo

bnaya / yarn-lock-changes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simek/yarn-lock-changes

1.0 0.0 0.0 537 KB

Creates a comment inside Pull Request with the human-readable summary of changes to the Yarn lock file.

Home Page: https://github.com/marketplace/actions/yarn-lock-changes

License: MIT License

JavaScript 100.00%

yarn-lock-changes's Introduction

Yarn Lock Changes

Creates a comment inside Pull Request with the human-readable summary of the changes to the yarn.lock file. Works in public and private repositories, offers a degree of customization.

Usage

⚡️ Workflow Example

Example below shows the minimal workflow setup and all the optional inputs for the action (set to theirs default values). If you are happy with the output generated by the action, it's safe to remove all optional inputs.

name: Yarn Lock Changes
on: [pull_request]

jobs:
  yarn_lock_changes:
    runs-on: ubuntu-latest
    # Permission overwrite is required for Dependabot PRs, see "Common issues" below
    permissions:
      pull-requests: write
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      # Please use `main` as version before the stable release will be published as `v1`
      - name: Yarn Lock Changes
        uses: Simek/yarn-lock-changes@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          # Optional inputs, can be deleted safely if you are happy with default values
          collapsibleThreshold: 25
          failOnDowngrade: false
          path: yarn.lock
          updateComment: true

🔌 Inputs

Input Required Default Description
collapsibleThreshold No 25 Number of lock changes, which will result in collapsed comment content and an addition of changes summary table.
failOnDowngrade No false When a dependency downgrade is detected, fail the action. Comment will still be posted.
path No yarn.lock Path to the yarn.lock file in the repository. Default value points to the file at project root.
token Yes Repository GITHUB_TOKEN which allows action to make calls to the GitHub API (Octokit).
updateComment No true Update the comment on each new commit. If value is set to false, bot will post a new comment on each change.

📸 Preview

Basic comment appearance

basic

Comment appearance when collapsibleThreshold has been reached

summary

📋 Common issues

The action fails on the Dependabot pull requests

Due to the security reasons from March 1st, 2021 workflow runs that are triggered by Dependabot have permissions reduced by default:

To ensure that sufficient permissions for this action are always granted, you will need to add permissions entry to the job which runs yarn-lock-changes:

jobs:
  ...:
    runs-on: ...
    #####
    permissions:
      pull-requests: write
    #####
    steps:
      ...

🔍️ Debugging

To run action in the debug mode you need to add the ACTIONS_STEP_DEBUG repository secret and set it to true, as stated in the GitHub documentation.

Then additional information which might be useful for the users when debugging the issues will be available in the action output, prefixed by ##[debug].

yarn-lock-changes's People

Contributors

simek avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.