Code Monkey home page Code Monkey logo

actions-lib's People

Contributors

bgilbert avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

actions-lib's Issues

Using curl instead of gh-cli

I recently had a look at how the "require file change"-composite action is set up and noticed that it uses bare curl statements to retrieve the PR information it needs.

Is there a particular reason that the gh-cli isn't used for this? It is (to my knowledge) preinstalled on all GH provided runners and should make interacting with the API easier/more robust?

For example the diffinfo retrieval could be rewritten similar to:

diffinfo=$(gh pr view --repo "${{ github.event.pull_request.html_url }}" \
            --json 'files' \
            --jq '.files[] | select(.path == "${{ inputs.path }}")')

Instead of using:

diffinfo=$(curl --no-progress-meter \
            -H "Accept: application/vnd.github+json" \
            -H "Authorization: token ${{ inputs.token || github.token }}" \
            "https://api.github.com/repos/${{ github.repository }}/compare/${{ github.event.pull_request.base.sha }}...${{ github.event.pull_request.head.sha }}" |
            jq '.files[] | select(.filename == "${{ inputs.path }}")')

The label-retrieval would look similarly like this:

label=$(gh pr view --repo "${{ github.event.pull_request.html_url }}" \
         --json 'labels' \
         --jq '.labels[] | select(.name == "${{ inputs.override-label }}")')

Additionally, by setting GH_TOKEN with a value of ${{ inputs.token || github.token }} via the action environment authentication is fully handled.

Require PR submitters to provide a reason for skipping notes

Using a skip-notes label is convenient, but humans are creatures of habit and it doesn't take long before reviewers get used to seeing the skip-notes label and scan right past it.

One way to counter this is instead of a label, PR submitters that want to skip release notes have to either provide e.g. a footer in the initial PR description (such as skip-notes: <reason>) or alternatively as a stand-alone comment. This will increase the likelihood that reviewers read the reason and they may then decide to discuss it.

check-diff shows at most 10 warnings

GitHub renders at most 10 annotations in the PR diff view and the workflow run summary page. An unlimited number of warnings is shown in the check-diff job log, but the log is less ergonomic, so usually it's not used when a reviewer is examining the diff. Thus it's possible that a reviewer might miss some changes.

Clearly indicate that some warnings have been elided, perhaps by emitting at most 9 warnings plus a notice to check the log.

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.