aws-secrets-manager-actions
                                
                                
                                
                                    aws-secrets-manager-actions copied to clipboard
                            
                            
                            
                        Change file output to end with newline?
I am using this great package for some GitHub Actions which export some environment variables to a file.  One issue I am running into is that I am using DamianReeves/write-file-action to append additional environment variables to the outputted file.  However, because of the limitations of .yml files, I am unable to insert a preceeding line break in the DamianReeves/write-file-action content property, so the appended items corrupt the last line of the output file from your action.  I think this would be easily solved if the output file content has all items output with a newline at the end.
In order to make all lines end with a newline (including the last line), would it be acceptable to change this line:
      const secretsAsEnv = Object.entries(parsedSecret).map(([key, value]) => `${key}=${value}`).join('\n')
to this:
      const secretsAsEnv = Object.entries(parsedSecret).map(([key, value]) => `${key}=${value}\n`)
                                    
                                    
                                    
                                
Sorry I can't understand seriously. Could you show me usage gh action code with DamianReeves/write-file-action?
Sure - this is showing leaving a blank line in the DamianReeves/write-file-action routine:
    - name: Export ENV from AWS Secret Manager
      uses: say8425/aws-secrets-manager-actions@v2
      with:
         SECRET1: ${{ secrets.SECRET1 }}
         SECRET2: ${{ secrets.SECRET2 }}
         OUTPUT_PATH: '.env' # optional
       
    - name: Append text to .env file
      uses: "DamianReeves/write-file-action@master"
      with:
        path: '.env'
        contents: |
          SECRET3=${{ secrets.SECRET3 }}
        write-mode: append
Would result in an .env file of:
SECRET1=***
SECRET2=***SECRET3=***