fix: use RUNNER_TEMP in build-release.yml (#10586)

Second pass at fixing the issue documented in #10583, as it contains to fail: https://codeberg.org/forgejo-integration/forgejo/actions/runs/14694/jobs/0/attempt/1#jobstep-13-7.  Hoping that it is failing because RUNNER_TEMP is different than expected in the LXC environment, but additional `git` output commands should clarify the issue if this doesn't work.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [ ] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] I do not want this change to show in the release notes.
- [ ] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10586
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net>
Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
This commit is contained in:
Mathieu Fenniak 2025-12-26 16:12:17 +01:00 committed by Mathieu Fenniak
parent e3b4c960da
commit 5261e86fad

View file

@ -227,12 +227,21 @@ jobs:
curl -sS -X DELETE $url/api/v1/repos/forgejo-experimental/forgejo/releases/tags/$tag > /dev/null
curl -sS -X DELETE $url/api/v1/repos/forgejo-experimental/forgejo/tags/$tag > /dev/null
fi
# FIXME: remove these diagnostic commands that are intended to ensure the `rm` below works.
git config --list
echo "RUNNER_TEMP = $RUNNER_TEMP"
# actions/checkout@v6 sets http.https://codeberg.org/.extraheader with the automatic token. Get rid of it so
# it does not prevent using the token that has write permissions. As of @v6, it is stored in
# /tmp/git-credentials-(uuid).config and included in the repo via
# includeif.gitdir:...=/tmp/git-credentials-(uuid).config. Since we don't need these credentials anymore we
# can just remove the generated config file.
rm /tmp/git-credentials-*
# $RUNNER_TEMP/git-credentials-(uuid).config and included in the repo via
# includeif.gitdir:...=$RUNNER_TEMP/git-credentials-(uuid).config. Since we don't need these credentials
# anymore we can just remove the generated config file.
rm -f $RUNNER_TEMP/git-credentials-*
# FIXME: remove these diagnostic comamnds that are intended to ensure the `rm` above works.
git config --list
if test -f .git/shallow ; then
echo "unexpected .git/shallow file is present"
echo "it suggests a checkout --depth X was used which may prevent pushing the commit"