Adding Forgejo support (#23)

Signed-off-by: Janos Bonic <86970079+janosdebugs@users.noreply.github.com>
Co-authored-by: Bence Santha <bence@santha.eu>
This commit is contained in:
Janos 2024-01-30 19:49:40 +01:00 committed by GitHub
parent 24b9f144af
commit da3271e0a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 36 additions and 17 deletions

View file

@ -132,13 +132,19 @@ async function run () {
const credentialsHostname = core.getInput('cli_config_credentials_hostname');
const credentialsToken = core.getInput('cli_config_credentials_token');
const wrapper = core.getInput('tofu_wrapper') === 'true';
let githubToken = core.getInput('github_token');
if (githubToken === '' && !(process.env.FORGEJO_ACTIONS || process.env.GITEA_ACTIONS)) {
// Only default to the environment variable when running in GitHub Actions. Don't do this for other CI systems
// that may set the GITHUB_TOKEN environment variable.
githubToken = process.env.GITHUB_TOKEN;
}
// Gather OS details
const osPlatform = os.platform();
const osArch = os.arch();
core.debug(`Finding releases for OpenTofu version ${version}`);
const release = await releases.getRelease(version);
const release = await releases.getRelease(version, githubToken);
const platform = mapOS(osPlatform);
const arch = mapArch(osArch);
const build = release.getBuild(platform, arch);