Skip to content
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

Respect original content when creating secrets (#24745) #24746

Merged
merged 1 commit into from
May 16, 2023

Commits on May 16, 2023

  1. Respect original content when creating secrets (go-gitea#24745)

    Fix go-gitea#24721.
    
    Follow what GitHub does:
    - Don't trim spaces for secrets.
    - Newline should be `\n` instead of `\r\n`.
    
    Did some tests with:
    
    ```yaml
    name: secrets
    on: push
    jobs:
      show_secrets:
        runs-on: ubuntu-latest
        steps:
          - name: Dump secrets context
            run: echo '${{ toJSON(secrets) }}' | base64
    ```
    
    `AAAAAA`:
    ```text
       AAAAAA
    AAAAAA
    
    
    ```
    `BBBBBB`:
    ```text
    
    
    
    BBBBBB
    BBBBBB   
    ```
    
    
    On GitHub:
    
    <img width="675" alt="image"
    src="https://github.com/go-gitea/gitea/assets/9418365/0ec60652-c2a3-47bb-9f9d-7e81665355a8">
    
    
    On Gitea (before):
    
    <img width="673" alt="image"
    src="https://github.com/go-gitea/gitea/assets/9418365/cce818bf-5edc-4656-86e1-2c81c304cdb2">
    
    On Gitea (after):
    
    <img width="673" alt="image"
    src="https://github.com/go-gitea/gitea/assets/9418365/0b3b15af-4d48-4bab-a334-4738a1b0eb4a">
    wolfogre authored and GiteaBot committed May 16, 2023
    Configuration menu
    Copy the full SHA
    9974fe8 View commit details
    Browse the repository at this point in the history