Skip to content

Commit

Permalink
Merge branch 'master' into fix_env_var
Browse files Browse the repository at this point in the history
  • Loading branch information
Almenon committed Mar 31, 2024
2 parents a7749f2 + 0d545f4 commit 941f668
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 84 deletions.
14 changes: 2 additions & 12 deletions .github/workflows/container-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,9 @@ on:
branches: [master]
tags: ["*"]

# run on PRs against master
pull_request:
branches: [master]

# manual trigger
workflow_dispatch:
inputs:
tag:
description: Build a container image for this git tag
required: true

permissions:
packages: write # ghcr access
contents: write # create releases

env:
# GitHub Container Registry hostname
Expand Down Expand Up @@ -81,7 +71,7 @@ jobs:
- name: Build the container image
uses: docker/build-push-action@v5
with:
push: ${{ github.event.inputs.tag != '' || startsWith(github.event.push.ref, 'refs/tags/') }}
push: true
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Get the version
id: get_version
run: echo VERSION=${GITHUB_REF#refs/tags/v} >> $GITHUB_OUTPUT
- uses: jmgilman/actions-generate-checksum@24a35957fba81c6cbaefeb1e3d59ee56e3db5077
- uses: jmgilman/actions-generate-checksum@521a903edf511407d8bd5535d257402fd9bb5db0
id: checksums
with:
patterns: "build/${{ steps.get_version.outputs.VERSION }}/*"
Expand Down
126 changes: 66 additions & 60 deletions CONTRIBUTORS.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions cmd/config.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"io/ioutil"
"os"

log "github.com/sirupsen/logrus"

Expand Down Expand Up @@ -70,7 +70,7 @@ type AutoplanConfig struct {
// in to preserve some parts of the old config
func readOldConfig() (*AtlantisConfig, error) {
// The old file not existing is not an error, as it should not exist on the very first run
bytes, err := ioutil.ReadFile(outputPath)
bytes, err := os.ReadFile(outputPath)
if err != nil {
log.Info("Could not find an old config file. Starting from scratch")
return nil, nil
Expand Down
5 changes: 2 additions & 3 deletions cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"golang.org/x/sync/singleflight"

"context"
"io/ioutil"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -880,7 +879,7 @@ func main(cmd *cobra.Command, args []string) error {

// Write output
if len(outputPath) != 0 {
ioutil.WriteFile(outputPath, []byte(yamlString), 0644)
os.WriteFile(outputPath, []byte(yamlString), 0644)
} else {
log.Println(yamlString)
}
Expand Down Expand Up @@ -958,5 +957,5 @@ func RunWithFlags(filename string, args []string) ([]byte, error) {
rootCmd.SetArgs(args)
rootCmd.Execute()

return ioutil.ReadFile(filename)
return os.ReadFile(filename)
}
11 changes: 5 additions & 6 deletions cmd/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package cmd

import (
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
Expand Down Expand Up @@ -74,7 +73,7 @@ func runTest(t *testing.T, goldenFile string, args []string) {
return
}

goldenContentsBytes, err := ioutil.ReadFile(goldenFile)
goldenContentsBytes, err := os.ReadFile(goldenFile)
goldenContents := &AtlantisConfig{}
yaml.Unmarshal(goldenContentsBytes, goldenContents)
if err != nil {
Expand Down Expand Up @@ -331,7 +330,7 @@ func TestPreservingOldWorkflows(t *testing.T) {
steps:
- run: terragrunt plan -no-color -out $PLANFILE
`)
ioutil.WriteFile(filename, contents, 0644)
os.WriteFile(filename, contents, 0644)

content, err := RunWithFlags(filename, []string{
"generate",
Expand All @@ -345,7 +344,7 @@ func TestPreservingOldWorkflows(t *testing.T) {
return
}

goldenContents, err := ioutil.ReadFile(filepath.Join("golden", "oldWorkflowsPreserved.yaml"))
goldenContents, err := os.ReadFile(filepath.Join("golden", "oldWorkflowsPreserved.yaml"))
if err != nil {
t.Error("Failed to read golden file")
return
Expand Down Expand Up @@ -377,7 +376,7 @@ func TestPreservingOldProjects(t *testing.T) {
dir: someDir
name: projectFromPreviousRun
`)
ioutil.WriteFile(filename, contents, 0644)
os.WriteFile(filename, contents, 0644)

content, err := RunWithFlags(filename, []string{
"generate",
Expand All @@ -392,7 +391,7 @@ func TestPreservingOldProjects(t *testing.T) {
return
}

goldenContents, err := ioutil.ReadFile(filepath.Join("golden", "oldProjectsPreserved.yaml"))
goldenContents, err := os.ReadFile(filepath.Join("golden", "oldProjectsPreserved.yaml"))
if err != nil {
t.Error("Failed to read golden file")
return
Expand Down

0 comments on commit 941f668

Please sign in to comment.