Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: Fix use of paths-filter on master pushes #16507

Merged
merged 1 commit into from
Jun 11, 2021

Conversation

pchaigno
Copy link
Member

For pull requests, paths-filter retrieves the list of changed files via the GitHub API, but for pushes it needs access to the code. When a workflow is triggered by a push to master, we therefore need to checkout the source code before using paths-filter.

This change fixes the errors:

Run dorny/paths-filter@78ab00f87740f82aec8ed8826eb4c3c851044126
Get current git ref
  /usr/bin/git branch --show-current
  fatal: not a git repository (or any of the parent directories): .git
Error: The process '/usr/bin/git' failed with exit code 128

I tested it by pushing to my fork's default branch. The result can be seen at: https://github.com/pchaigno/cilium/runs/2801208965?check_suite_focus=true.

Reported-by: André Martins andre@cilium.io

For pull requests, paths-filter retrieves the list of changed files via
the GitHub API, but for pushes it needs access to the code. When a
workflow is triggered by a push to master, we therefore need to checkout
the source code before using paths-filter.

This change fixes the errors:

    Run dorny/paths-filter@78ab00f
    Get current git ref
      /usr/bin/git branch --show-current
      fatal: not a git repository (or any of the parent directories): .git
    Error: The process '/usr/bin/git' failed with exit code 128

Reported-by: André Martins <andre@cilium.io>
Signed-off-by: Paul Chaignon <paul@cilium.io>
@pchaigno pchaigno added kind/bug/CI This is a bug in the testing code. area/CI Continuous Integration testing issue or flake release-note/ci This PR makes changes to the CI. labels Jun 11, 2021
@pchaigno pchaigno requested review from a team as code owners June 11, 2021 08:37
@pchaigno pchaigno requested a review from tklauser June 11, 2021 08:37
@pchaigno pchaigno requested a review from nbusseneau June 11, 2021 08:37
@aanm aanm merged commit 785bd5d into cilium:master Jun 11, 2021
@pchaigno pchaigno deleted the fix-paths-filter-on-pushes branch June 11, 2021 09:40
@joamaki
Copy link
Contributor

joamaki commented Oct 20, 2021

Added needs-backport/1.10 as the v1.10 branch build is hitting the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CI Continuous Integration testing issue or flake kind/bug/CI This is a bug in the testing code. release-note/ci This PR makes changes to the CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants