-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
tdnf
not working in GitHub Actions
#29835
Comments
I tested with the below task and - name: Azure CLI script
uses: azure/cli@v2
with:
azcliversion: 2.64.0
inlineScript: |
set -x
env
env | base64
tdnf install -y zip
zip --help
tdnf install -y jq
jq --help Output:
The env var @mr-sven, could you please share more information on your action and how to repro the error? |
Running via Container does not work: deploy:
needs: build
runs-on: [self-hosted, linux, docker]
container: mcr.microsoft.com/azure-cli
steps:
- name: Cleanup build folder
run: |
tdnf install -y zip In the end it will be a general issue if someone uses the Image on custom pipelines or whatever. |
@mr-sven, thanks for the information. I am able to repro with GitHub-hosted runners too: on: [push, workflow_dispatch]
name: AzureCLISample
permissions:
id-token: write
contents: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container: mcr.microsoft.com/azure-cli
steps:
- name: Test tdnf
run: |
env
tdnf install -y zip Output:
This is different from what is in
@MoChilia, do you have any insights on this inconsistency? |
When running GitHub Action jobs in a container, the command I have tested this using the @mr-sven, since using the - name: Azure CLI script
uses: azure/cli@v2
with:
azcliversion: 2.64.0
inlineScript: |
tdnf install -y zip
<Your Azure CLI commands here> |
That will work. steps:
- name: Azure CLI zip install
uses: azure/cli@v2
with:
azcliversion: 2.64.0
inlineScript: |
tdnf install -y zip
- name: Azure cli zip use
uses: azure/cli@v2
with:
azcliversion: 2.64.0
inlineScript: |
zip -r publish.zip .
By using this I'm forced to combine clear separated and visible steps into a single shell script. |
@mr-sven, yes, you’ll need to put all steps into a single task when using azure/cli action. But I am afraid there is no better workaround at the moment. This issue of "$HOME overridden for containers" has been reported since 2020, and no good solution has been found yet. See actions/runner#863. |
As I mentioned above, if you set the env variable |
@mr-sven, you're right. Setting To summarize, here are two solutions for this issue:
Closing this issue for now, as it caused by GitHub Actions and solutions are available. |
Using
tdnf
works on direct container run only:Same command on Github actions failed
Problem is, the GPG keys are located under
/root/.gnupg
but github actions has home at/github/home
so it's broken.Originally posted by @mr-sven in #29827 (comment)
The text was updated successfully, but these errors were encountered: