internal/ci: use OIDC with the Central Registry for the e2e tests
This way we no longer need to maintain a static token as a CI secret
via E2E_PORCUEPINE_CUE_TOKEN. Two changes were needed for this to work:
First, the OIDC setup sets up logins.json rather than setting up
any env var or other state with a token string,
so we need to teach internal/_e2e how to inherit the registry logins
from the host rather than taking an access token string.
Note that we still allow setting CUE_TEST_TOKEN to an access token,
because this is still useful for developers whose machines are logged
into the central registry as themselves and not porcuepine.
Second, the OIDC setup is tweaked to add new rules for the
protected branches "master" and "ci/test",
with the same other settings we had except that the account
is swapped from "notcueckoo" to "porcuepine",
which has the necessary access to make the end-to-end tests succeed.
This works because these new rules are narrower by adding a branch
filter on top of all the other filters,
so the Central Registry applies this new rule when both match
given that it is more specific.
This was tested via ci/test in:
https://github.com/cue-lang/cue/actions/runs/22581435336/job/65414331280
Once this patch is merged, I'll go ahead and remove
the E2E_PORCUEPINE_CUE_TOKEN secret on GitHub Actions.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I76cf0e02ccf50bfd4619e8083a1379a336f3d08c
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1232501
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>