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

Github Action GITHUB_SHA #567

Open
T0biii opened this issue Jan 21, 2025 · 0 comments · May be fixed by #568
Open

Github Action GITHUB_SHA #567

T0biii opened this issue Jan 21, 2025 · 0 comments · May be fixed by #568

Comments

@T0biii
Copy link
Member

T0biii commented Jan 21, 2025

The Firmware-Version seems to be a bit of, the git describe --tags in the makefile via Github Actions provides a different GITHUB_SHA Value then the last commit in the PR

https://github.com/freifunkMUC/site-ffm/blob/gluon-v2023.2.x/.github/workflows/firmware.yml#L61

3f9bce8
Image
ddf3c15
Image

3f9bce8 != ddf3c15

More Info:

But this is not the GITHUB_SHA for pull_request event. The GITHUB_REF for pull_request event is PR merge branch refs/pull/:prNumber/merge. And the GITHUB_SHA is the last merge commit on the GITHUB_REF branch. This GITHUB_SHA does not exist in any current branch in repo. So you will get fatal: bad object.

Solutions:

if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
    GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)
fi
T0biii added a commit that referenced this issue Jan 21, 2025
@T0biii T0biii linked a pull request Jan 21, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant