opentofu / setup-opentofu Goto Github PK
View Code? Open in Web Editor NEWLicense: Mozilla Public License 2.0
License: Mozilla Public License 2.0
The current wrapper today exposes some output information about the execution of the command.
It would be nice to add some additional output including the number of resources to be:
I for execute some conditions based on those numbers and today I'm getting them parsing the out. I think it would be nice to include them in the setOutput
of the wrapper already.
Let me know what you think
Hello guys.
Would it be possible to make opentofu/setup-opentofu
marked as "Verified creator" in GitHub Marketplace please?
Example (https://github.com/marketplace/actions/renovate-bot-github-action):
Thank you...
steps:
- uses: opentofu/setup-opentofu@v1
with:
tofu_version_file: ./.opentofu-version
Example similar action: https://github.com/actions/setup-go#getting-go-version-from-the-gomod-file
At the moment, you can cat the file and write the information from a file to GITHUB_OUTPUT in one job step, and in another setup-opentofu with version by referencing that output.
It would be a lot more convenient if it was possible to setup-opentofu in a single step by giving it the file location itself. There are two ways this can work.
A. My request: Use .opentofu-version file format (or .terraform-version, see tenv)
B. Possible additional feature: Allow pointing to the file containing required_versions block (perhaps as tofu_version_block_file or something)
Option A is a lot simpler, and personally for me is all I need at the moment.
Option B sounds like a good to have, and I imagine other people might require it.
Are these two feature requests acceptable to the maintainers? If there is a (decent quality) PR will it be merged?
As a user of the setup-opentofu action, I want to rely on it when using the wrapper for stdout processing.
The tofu stdout's content captured by the wrapper is prefixed with the command yielding it. Apparently, it's caused by the default behaviour of @actions/exec: see the condition.
Propagate stdout/err without relying on @action/exec. See new release of setup-terraform and the fix for context.
Hi team,
I am trying to use OpenTofu in self-hosted runner. However, it does not work:
Error: Error: failed fetching releases (401)
Error: failed fetching releases (401)
Here is my very simple setup:
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
plan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: opentofu/setup-opentofu@v1
Please kindly let me know how to bypass this situation. Thank you for your help!
The test release.js mocks HTTP calls to github API wrongly. It led to testing side effects and unnecessarily quota consumption, see example.
Fix the "unhappy path" tests relying on the mock function fetchReleases
As a nit, nock can be removed from dependencies because it's not used.
Hello.
This is a part of my github action file.
`jobs:
DeployTerraform:
runs-on: ubuntu-latest
name: "Deploy S"
steps:
- name: Git clone the repository
uses: actions/checkout@v3
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::9999999:role/github-devops
role-session-name: devops-s
aws-region: ${{ env.REGION }}
- name: Setup OpenToFu
uses: opentofu/setup-opentofu@v1
with:
terraform_version: 1.6.0
- name: OpenToFu Init
run: |
cd environments/${{ env.ENVIRONMENT }}/${{ env.REGION }}
tofu init
- name: OpenToFu Plan
run: |
cd environments/${{ env.ENVIRONMENT }}/${{ env.REGION }}
tofu plan -out=terraform.to.execute
- name: OpenToFu Apply
if: github.event_name != 'schedule'
run: |
cd environments/${{ env.ENVIRONMENT }}/${{ env.REGION }}
tofu apply terraform.to.execute`
I have terraform_version in 1.6.0, but this error happen.
`Successfully configured the backend "s3"! OpenTofu will automatically
use this backend unless the backend configuration changes.
Initializing modules...
My code is:
- uses: opentofu/setup-opentofu@v1
with:
tofu_wrapper: false
- run: go mod download
- env:
TF_ACC: "1"
TF_ACC_PROVIDER_NAMESPACE: "hashicorp"
TF_ACC_PROVIDER_HOST: "registry.opentofu.org"
run: TF_ACC_TERRAFORM_PATH=$(which tofu) go test -v -cover ./cilium
timeout-minutes: 10
Could you create automatically the environment variables?
Like that, my code would be clean:
- uses: opentofu/setup-opentofu@v1
with:
tofu_wrapper: false
acceptance_test: true
- run: go mod download
- run: go test -v -cover ./cilium
timeout-minutes: 10
The debugging logs will be emitted by default. For example:
Plan: 1 to add, 0 to change, 0 to destroy.
neon_project.this: Creating...
neon_project.this: Creation complete after 1s [id=blue-cloud-40428863]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
::debug::OpenTofu exited with code 0.
Make debugging logs optional. They could be activated following the github instructions.
Before:
branding:
icon: 'terminal'
color: 'purple'
After:
branding:
icon: 'trending-up'
color: 'yellow'
This behavior matches setup-terraform
.
It does not appear to be working according to the documentation. https://github.com/northwood-labs/terraform-provider-corefunc/actions/runs/7748820624/job/21132182279
The setup-opentofu
action is accessing the public GitHub API to retrieve all respective releases and the download URLs, respectively. This mechanism might fail when the GitHub API quota is reached for anonymous requests:
Run opentofu/setup-opentofu@v1
Error: Error: failed fetching releases (403)
Error: failed fetching releases (403)
A recent change (#15) added the possibility to provide a GitHub token to avoid hitting the GitHub API quota. This approach might not work for all users that are using the action in a private GitHub enterprise instance as they are unable to supply a valid token.
Is there any possibility to completely avoid using the GitHub API?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.