Giter Site home page Giter Site logo

hellofresh / action-changed-files Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 7.0 102 KB

GitHub Action for matrix generation based on changed files matched against regular expressions

License: Apache License 2.0

Python 100.00%
github-actions open-source

action-changed-files's People

Contributors

antonu17 avatar dependabot[bot] avatar gh-automation-app[bot] avatar gmsantos avatar hf-ghactions-bot avatar hf-security avatar klemmster avatar raghavtan avatar vixus0 avatar zlahham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

action-changed-files's Issues

Handle deletion better

If a pull-request contains deletions, the script isn't equipped to not generate a job matrix entry for this match.

The logic might be a bit tricky to implement properly, so we need to be extra careful.

Rewrite action in JS

To use the native approach of GitHub Actions, which also gives us an authenticated Octokit client and fits better in the ecosystem in general.

Add Dependabot

From #18, it will make it easier if you just get dependabot to sort out the version bump PRs for the github actions used in your workflows

Pagination support

With PRs container many file changes, the list return by https://api.github.com/repos/{args.github_repository}/compare/{quote_plus(args.github_base_ref)}...{quote_plus(args.github_head_ref)} is cut off, if pagination is not enabled. Would it be possible to support pagination, as described here?

Deprecation warning

Hi, I've been running the latest version of your job. It seems that using set-output is deprecated and will be deleted soon. It would make this action unusable. Find the warning below:

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Output only generating 136 jobs

Hello, I am running the matrix generation job on a folder containing ~240 sub-folders. I am pushing all the folders in one commit.
The matrix generation job is only outputting the first ~140 folders even though all of them are being added.
Is there a limit on the number of outputs ?

Bug: Incorrect Base Commit

This is a bug where an HTTPError 404 is being returned when attempting to make a request to the GitHub API for a repository comparison using the base commit "0000000000000000000000000000000000000000". The error message indicates that the requested resource could not be found on the server. The reason for this error is likely due to the fact that the base commit specified is incorrect. "0000000000000000000000000000000000000000" is a null sha1 hash, this means that the commit doesn't exist in the repository and thus it's impossible to compare it with a valid commit sha1 hash.
It's a common mistake when working with git, when specifying a base commit sha1 hash that doesn't exist in the repository it will lead to this error.

INFO:root:GitHub API request: https://api.github.com/repos/org/repo/compare/0000000000000000000000000000000000000000...48adb89ed9d007de9279ee10f3e693726d099de6
Traceback (most recent call last):
  File "/home/runner/work/_actions/hellofresh/action-changed-files/v3/neo/neo.py", line 245, in <module>
    matrix = main(**args)
  File "/home/runner/work/_actions/hellofresh/action-changed-files/v3/neo/neo.py", line 132, in main
    r = session.get(compare_url)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 662, in send
    r = dispatch_hook('response', hooks, r, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/hooks.py", line 31, in dispatch_hook
    _hook_data = hook(hook_data, **kwargs)
  File "/home/runner/work/_actions/hellofresh/action-changed-files/v3/neo/neo.py", line 119, in <lambda>
    "response": lambda resp, *resp_args, **kwargs: resp.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.github.com/repos/org/repo/compare/0000000000000000000000000000000000000000...48adb89ed9d007de9279ee10f3e693726d099de6

Missing request module

Hi.
I'm trying to execute sample workflow via Act, but getting error about missing request module.

name: Sample workflow

on:
  pull_request:
    branches:
      - master

jobs:
  generate-matrix:
    name: Generate job matrices
    runs-on: ubuntu-latest
    outputs:
      matrix-python-lib: ${{ steps.neo-python.outputs.matrix }}
    steps:
      - name: Generate matrix | Infrastructure
        id: neo-python
        uses: hellofresh/action-changed-files@v3
        with:
            pattern: ^\w+/python/(?P<environment>[^/]+)
            default-patterns: |
                schellar/python

[Sample workflow/Generate job matrices] ๐Ÿณ docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/neo-python-composite-neo.sh] user= workdir=
| Traceback (most recent call last):
| File "/var/run/act/actions/hellofresh-action-changed-files@v3/neo/neo.py", line 8, in
| import requests
| ModuleNotFoundError: No module named 'requests'

Update actions/checkout

I'm seeing warnings in workflows where I'm using action-changed-files related to the usage of node16 in actions/checkout@v3. I see it's used here

Would the maintainers be open to a PR creating updating the checkout action to v4? I'm happy to do it.

Warning in workflow:
Screenshot 2024-03-12 at 13 29 18

I'm also wondering if we could remove the checkout action all together from this composite action. I would prefer the parent workflow be responsible for checking out the repo.

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.