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 Actions do not work - OIDC ref. is wrongly setup #265

Open
leo-schick opened this issue Jan 28, 2024 · 2 comments
Open

GitHub Actions do not work - OIDC ref. is wrongly setup #265

leo-schick opened this issue Jan 28, 2024 · 2 comments
Labels
bug Something isn't working needs research or confirmation This issue needs more research and documentation before being accepted.

Comments

@leo-schick
Copy link
Contributor

Describe the bug
When I deploy this repository from script, the predefined GitHub actions will not work. I get the following error message:

image

I took a look at the created OIDC app and found out that the subject is set up differently:

image
(screenshot in german, sorry :-) )

I changed the "Antragstellerbezeichner" from repo:git@github.com:myorganization/azure-saas.git:ref:refs/heads/main to repo:myorganization/azure-saas:ref:refs/heads/main and then it worked.

So the script creates the OIDC federation credentials with the wrong parameters.

Expected behavior

When running script create-oidc-workflow-github-action.sh, it should correctly setup the federation credentials .

Desktop (please complete the following information):

  • OS: Ubuntu on WSL
  • Browser -
  • Version -
@leo-schick leo-schick added the bug Something isn't working label Jan 28, 2024
@1iveowl
Copy link
Collaborator

1iveowl commented Feb 10, 2024

This has been tested, so not sure if this issue is caused by some dependencies have been updated/changed or if something else is at play. Need to investigate further.

@1iveowl 1iveowl added the needs research or confirmation This issue needs more research and documentation before being accepted. label Feb 10, 2024
@leo-schick
Copy link
Contributor Author

leo-schick commented Apr 14, 2024

I think I found now the reason for it, but could not fix it finally: the issue is the code here:

The git remote url is taken and the organization and project name is extracted. This works fine when one use a HTTPS git remote url. For example:

$ echo "https://github.com/Azure/azure-saas.git" | sed 's/.*\/\([^ ]*\/[^.]*\).*/\1/'
Azure/azure-saas

But this does not work out when I use a git url:

$ echo "git@github.com:Azure/azure-saas.git" | sed 's/.*\/\([^ ]*\/[^.]*\).*/\1/'
git@github.com:Azure/azure-saas.git

In such a case, the sed parameter needs to be adjusted to use the : as separator:

$ echo "git@github.com:Azure/azure-saas.git" | sed 's/.*:\([^ ]*\/[^.]*\).*/\1/'
Azure/azure-saas

The parameter change helped me to fix it for me. But it will not work with a HTTPS urls. I tried to implement a or expression like (\/|:) but this does not work...

@1iveowl maybe that is something you could investigate further?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs research or confirmation This issue needs more research and documentation before being accepted.
Projects
None yet
Development

No branches or pull requests

2 participants