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

The head commit for this pull_request event is not ahead of the base commit #11

Open
nolanbconaway opened this issue Aug 18, 2020 · 11 comments

Comments

@nolanbconaway
Copy link

I squashed a bunch of commits from my PR into one, and now the action is giving me a message:

##[error]The head commit for this pull_request event is not ahead of the base commit. Please submit an issue on this action's GitHub repo.
All: [".github/workflows/black.yml"]
Added: [".github/workflows/black.yml"]
Modified: []
Removed: []
Renamed: []
Added or modified: [".github/workflows/black.yml"]

The issue is that the base commit as such no longer exists because it was squashed. However, it appears that the changed files list is still correct. Does this error need to be raised? what needs to happen to handle squashed base/head commits?

@Bertg
Copy link

Bertg commented Aug 25, 2020

I see the same issue. This is possibly related to #4 and #7

@justyn
Copy link

justyn commented Sep 7, 2020

I'm also seeing this issue, a lot of failing workflows - could an option be added to drop the error to a warning?

@mmalek-sa
Copy link

same issue here.

@ahoereth
Copy link

ahoereth commented Oct 28, 2020

Workaround:

       - uses: jitterbit/get-changed-files@v1
         id: files
         continue-on-error: true

@johentsch
Copy link

Same here

@dlam
Copy link

dlam commented Dec 12, 2020

A reliable way to reproduce this seems to be force push event

@javipolo
Copy link

Same here ...

nmelehan added a commit to nmelehan/docs that referenced this issue May 7, 2021
nmelehan added a commit to nmelehan/docs that referenced this issue May 7, 2021
andystevensname pushed a commit to linode/docs that referenced this issue May 14, 2021
* Integrate workaround for "head commit not ahead of base commit"

Workaround proposed here:
jitterbit/get-changed-files#11 (comment)

* Vale GHA: filter out files that aren't inside docs/ directory

- This helps avoid Vale running on non-content markdown files,
like our typography test page.
- A new select_docs_dir_files step is added. This step parses
and filters the JSON added_modified output from the
get_changed_files step. It then sets a new output for this
filtered file list that the Vale step later reads from.
- The jq command is used to filter the JSON list of files:
  https://stedolan.github.io/jq/
- This Stack Overflow served as inspiration:
  https://stackoverflow.com/questions/64482190/edit-the-value-inside-the-json-array-with-github-actions

* Only run the Vale step if list of files in docs/ is not empty

When the list of files was empty after the select_docs_dir_files
step ran, the action would hang at the Vale step:
https://github.com/linode/docs/pull/4304/checks?check_run_id=2546802169

* Vale GHA: add comments
sharkinsspatial added a commit to sharkinsspatial/staged-recipes that referenced this issue May 19, 2021
@Ana06
Copy link

Ana06 commented Jun 4, 2021

I have cherry-picked 54f3703 (which fixes this issue) and released it in Ana06/get-changed-files@v1.2. I hope this change makes it upstream. In case it doesn't (or until it does), feel free to use Ana06/get-changed-files@v1.2 (which also supports pull_request_target and allow to filter files using regular expressions).

VictorSanh added a commit to bigscience-workshop/promptsource that referenced this issue Jun 8, 2021
Xiol added a commit to ans-group/docs.ukfast.co.uk that referenced this issue Dec 6, 2021
When a set of commits is squashed and force pushed, it causes errors
with this action. See jitterbit/get-changed-files#11
@vmartinv
Copy link

I have cherry-picked 54f3703 (which fixes this issue) and released it in Ana06/get-changed-files@v1.2. I hope this change makes it upstream. In case it doesn't (or until it does), feel free to use Ana06/get-changed-files@v1.2 (which also supports pull_request_target and allow to filter files using regular expressions).

this fork fixed the issue for me

@sgibson91
Copy link

Would love to see the fork make it into this action!

@Bertg
Copy link

Bertg commented Apr 15, 2022

This issue has been open for a while.

We built an action similar to this one (not entirely the same) here https://github.com/younited/detect-branch-changes-action Maybe this can cover your case as well?

ueda-yu added a commit to ueda-yu/UedaVer_template that referenced this issue May 24, 2022
Change to follow jitterbit/get-changed-files#11 and use uses: Ana06/get-changed-files@v1.2
edasmalchi pushed a commit to cal-itp/data-analyses that referenced this issue Jun 9, 2022
see jitterbit/get-changed-files#11 for context

when commits are pushed, then later squashed and re-pushed, the action can fail

workaround is to continue on error, since the list of files changed is still correct
jmv74211 added a commit to wazuh/wazuh-qa that referenced this issue Jul 20, 2022
The previous one seems to have had a bug reported here jitterbit/get-changed-files#11
jmv74211 added a commit to wazuh/wazuh-qa that referenced this issue Jul 20, 2022
The previous one seems to have had a bug reported here jitterbit/get-changed-files#11
jmv74211 added a commit to wazuh/wazuh-qa that referenced this issue Jul 20, 2022
The previous one seems to have had a bug reported here jitterbit/get-changed-files#11
developerfred added a commit to developerfred/spellbook that referenced this issue Nov 18, 2022
martin-g added a commit to martin-g/openeuler-ohpc that referenced this issue Dec 20, 2022
jitterbit/get-changed-files@v1 often fails with errors like:

Base commit: c06f2fe
Head commit: 55342d5
Error: The head commit for this pull_request event is not ahead of the base commit. Please submit an issue on this action's GitHub repo.
All: components/perf-tools/msr-safe/SPECS/msr-safe.spec
Added:
Modified: components/perf-tools/msr-safe/SPECS/msr-safe.spec
Removed:
Renamed:
Added or modified: components/perf-tools/msr-safe/SPECS/msr-safe.spec

This issue is known since a long time but it seems the action is not
maintained anymore:
https://github.com/jitterbit/get-changed-files/issues?q=The+head+commit+for+this+pull_request+event+is+not+ahead

https://github.com/Ana06/get-changed-files is a maintained fork that
claims to have fixed this issue: jitterbit/get-changed-files#11 (comment)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
adrianreber pushed a commit to openhpc/ohpc that referenced this issue Dec 20, 2022
jitterbit/get-changed-files@v1 often fails with errors like:

Base commit: c06f2fe
Head commit: 55342d5
Error: The head commit for this pull_request event is not ahead of the base commit. Please submit an issue on this action's GitHub repo.
All: components/perf-tools/msr-safe/SPECS/msr-safe.spec
Added:
Modified: components/perf-tools/msr-safe/SPECS/msr-safe.spec
Removed:
Renamed:
Added or modified: components/perf-tools/msr-safe/SPECS/msr-safe.spec

This issue is known since a long time but it seems the action is not
maintained anymore:
https://github.com/jitterbit/get-changed-files/issues?q=The+head+commit+for+this+pull_request+event+is+not+ahead

https://github.com/Ana06/get-changed-files is a maintained fork that
claims to have fixed this issue: jitterbit/get-changed-files#11 (comment)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
marcusrbrown added a commit to bfra-me/ha-addon-repository that referenced this issue Jan 29, 2023
See jitterbit/get-changed-files#11. This action appears to be unmaintained and
is superceded by Ana06/get-changed-files.
hugovk added a commit to hugovk/cpython that referenced this issue Mar 7, 2023
hugovk added a commit to hugovk/cpython that referenced this issue Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests