forgejo/routers
Giteabot f6919e3e53
Respect original content when creating secrets (#24745) (#24746)
Backport #24745 by @wolfogre

Fix #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">

Co-authored-by: Jason Song <i@wolfogre.com>
(cherry picked from commit e4f200e616)
2023-05-23 07:42:33 +02:00
..
api Fix organization field being null in GET /api/v1/teams/{id} (#24694) (#24696) 2023-05-16 07:42:22 +02:00
common Support sanitising the URL by removing extra slashes in the URL (#21333) (#23300) 2023-03-05 02:14:12 -05:00
install [BRANDING] Rebrand default config settings for new installs (#140) 2023-05-10 11:05:21 +02:00
private Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
utils Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
web Respect original content when creating secrets (#24745) (#24746) 2023-05-23 07:42:33 +02:00
init.go [API] Forgejo API /api/forgejo/v1 2023-05-10 09:20:14 +02:00