Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-30 05:46:09 +01:00
forgejo/routers/web/shared
Jason Song d81659d039
Respect original content when creating secrets (#24745)
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">
2023-05-16 14:49:40 +08:00
..
actions Move secrets and runners settings to actions settings (#24200) 2023-04-27 20:08:47 -04:00
packages Add Cargo package registry (#21888) 2023-02-05 18:12:31 +08:00
secrets Respect original content when creating secrets (#24745) 2023-05-16 14:49:40 +08:00
user Add Gitea Profile Readmes (#23260) 2023-05-09 05:57:24 +00:00